Updated High Performance Order Storage Upgrade Recipe Book (markdown)
parent
cf9944d4ba
commit
098a715608
|
@ -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);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue