| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Initializers; |
| 4 |
|
| 5 |
use Automattic\WooCommerce\Utilities\FeaturesUtil; |
| 6 |
use Yoast\WP\SEO\Conditionals\No_Conditionals; |
| 7 |
|
| 8 |
/** |
| 9 |
* Declares compatibility with the WooCommerce HPOS feature. |
| 10 |
*/ |
| 11 |
class Woocommerce implements Initializer_Interface { |
| 12 |
|
| 13 |
use No_Conditionals; |
| 14 |
|
| 15 |
/** |
| 16 |
* Hooks into WooCommerce. |
| 17 |
* |
| 18 |
* @return void |
| 19 |
*/ |
| 20 |
public function initialize() { |
| 21 |
\add_action( 'before_woocommerce_init', [ $this, 'declare_custom_order_tables_compatibility' ] ); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Declares compatibility with the WooCommerce HPOS feature. |
| 26 |
* |
| 27 |
* @return void |
| 28 |
*/ |
| 29 |
public function declare_custom_order_tables_compatibility() { |
| 30 |
if ( \class_exists( FeaturesUtil::class ) ) { |
| 31 |
FeaturesUtil::declare_compatibility( 'custom_order_tables', \WPSEO_FILE, true ); |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|