Hooks.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\COT; |
| 4 | |
| 5 | use WPML\LIB\WP\Hooks as WPHooks; |
| 6 | use Automattic\WooCommerce\Utilities\FeaturesUtil as FeaturesUtil; |
| 7 | use WCML\StandAlone\IStandAloneAction; |
| 8 | |
| 9 | class Hooks implements \IWPML_Frontend_Action, \IWPML_Backend_Action, IStandAloneAction { |
| 10 | |
| 11 | const FEATURE = 'custom_order_tables'; |
| 12 | |
| 13 | public function add_hooks() { |
| 14 | WPHooks::onAction( 'before_woocommerce_init' ) |
| 15 | ->then( function() { |
| 16 | if ( class_exists( FeaturesUtil::class ) ) { |
| 17 | FeaturesUtil::declare_compatibility( self::FEATURE, WCML_PLUGIN_PATH . '/wpml-woocommerce.php', true ); |
| 18 | } |
| 19 | } ); |
| 20 | } |
| 21 | |
| 22 | } |
| 23 |