Updated High Performance Order Storage Upgrade Recipe Book (markdown)

Vedanshu Jain 2022-09-21 12:51:44 +05:30
parent cf9944d4ba
commit 098a715608
1 changed files with 6 additions and 16 deletions

@ -195,28 +195,18 @@ Once you examined the extension's code, you can declare whether it's compatible
```php
use Automattic\WooCommerce\Internal\Features\FeaturesController;
add_action(
'init',
function() {
FeaturesController::declare_compatibility( 'custom_order_tables', basename(__DIR__) );
}
);
add_action('before_woocommerce_init', function() {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
});
```
If you know your code doesn't support HPOS, you should declare incompatibility in the following way:
```php
use Automattic\WooCommerce\Internal\Features\FeaturesController;
add_action(
'init',
function() {
FeaturesController::declare_compatibility( 'custom_order_tables', basename(__DIR__), false );
}
);
add_action('before_woocommerce_init', function() {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, false);
});
```