Created
November 8, 2024 17:39
-
-
Save helgatheviking/d7823e4ecd2f7c2978c32ce0bf051a05 to your computer and use it in GitHub Desktop.
Add this snippet to your plugin's main file to declare compatibility with Woo "Features"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Declare Features compatibility. | |
*/ | |
add_action( 'before_woocommerce_init', function() { | |
if ( ! class_exists( 'Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { | |
return; | |
} | |
// HPOS (Custom Order tables) compatibility. | |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', plugin_basename( __FILE__ ), true ); | |
// Cart and Checkout Blocks. | |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', plugin_basename( __FILE__ ), true ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment