Add compatibility with HPOS (custom order tables) for WooCommerce (https://github.com/woocommerce/woocommerce-blocks/pull/7347)

This commit is contained in:
Alex Florisca 2022-10-10 13:21:07 +01:00 committed by GitHub
parent cc050e3cd6
commit 306165a100
1 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,14 @@ $minimum_wp_version = '6.0';
if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
}
// Declare comaptibility with custom order tables for WooCommerce
if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
add_action('before_woocommerce_init', function() {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
});
}
/**
* Whether notices must be displayed in the current page (plugins and WooCommerce pages).
*