| 1 |
<?php |
| 2 |
/** |
| 3 |
* Register the inner block for the WooCommerce checkout block. |
| 4 |
* |
| 5 |
* @author MyPreview (Github: @mahdiyazdani, @gooklani, @mypreview) |
| 6 |
* |
| 7 |
* @since 1.6.0 |
| 8 |
* |
| 9 |
* @package woo-additional-terms |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace Woo_Additional_Terms\WooCommerce\Block; |
| 13 |
|
| 14 |
/** |
| 15 |
* Register editor block. |
| 16 |
*/ |
| 17 |
class Register { |
| 18 |
|
| 19 |
/** |
| 20 |
* Setup hooks and filters. |
| 21 |
* |
| 22 |
* @since 1.6.0 |
| 23 |
* |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public function setup() { |
| 27 |
|
| 28 |
add_action( 'woocommerce_blocks_checkout_block_registration', array( $this, 'block_registration' ) ); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Registers block type and registers with WC Blocks Integration Interface. |
| 33 |
* |
| 34 |
* @since 1.6.0 |
| 35 |
* |
| 36 |
* @param object $integration_registry WC Blocks integration registry. |
| 37 |
* |
| 38 |
* @return void |
| 39 |
*/ |
| 40 |
public function block_registration( $integration_registry ) { |
| 41 |
|
| 42 |
$integration_registry->register( new Block() ); |
| 43 |
} |
| 44 |
} |
| 45 |
|