flexible-shipping
/
src
/
WPDesk
/
FS
/
TableRate
/
ShippingMethod
/
BlockEditing
/
BlockEditing.php
BlockEditing.php
39 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class BlockEditing |
| 4 | * |
| 5 | * @package WPDesk\FS\TableRate\ShippingMethod\BlockEditing |
| 6 | */ |
| 7 | |
| 8 | namespace WPDesk\FS\TableRate\ShippingMethod\BlockEditing; |
| 9 | |
| 10 | use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable; |
| 11 | |
| 12 | /** |
| 13 | * Block edit settings of FS Group. |
| 14 | */ |
| 15 | class BlockEditing implements Hookable { |
| 16 | /** |
| 17 | * Hooks. |
| 18 | */ |
| 19 | public function hooks() { |
| 20 | add_action( 'flexible_shipping_method_script', array( $this, 'block_shipping_method_script' ), 10, 2 ); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @param string $method_id . |
| 25 | * @param int $instance_id . |
| 26 | */ |
| 27 | public function block_shipping_method_script( $method_id, $instance_id ) { |
| 28 | if ( 'flexible_shipping' !== $method_id ) { |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | if ( apply_filters( 'flexible-shipping/group-method/supports/edit', false ) === true ) { |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | include __DIR__ . '/views/block-settings.php'; |
| 37 | } |
| 38 | } |
| 39 |