Automattic\WooCommerce\Database\Migrations\CustomOrderTable
CLIRunner::is_enabled
Check if the COT feature is enabled.
Method of the class: CLIRunner{}
No Hooks.
Returns
true|false. Whether the COT feature is enabled.
Usage
// private - for code of main (parent) class only $result = $this->is_enabled( $log ): bool;
- $log(true|false)
- Optionally log a error message.
Default:true
CLIRunner::is_enabled() CLIRunner::is enabled code WC 10.6.2
private function is_enabled( $log = true ): bool {
if ( ! $this->controller->custom_orders_table_usage_is_enabled() ) {
if ( $log ) {
WP_CLI::log(
sprintf(
// translators: %s - link to testing instructions webpage.
__( 'Custom order table usage is not enabled. If you are testing, you can enable it by following the testing instructions in %s', 'woocommerce' ),
'https://developer.woocommerce.com/docs/features/high-performance-order-storage/recipe-book/'
)
);
}
}
return $this->controller->custom_orders_table_usage_is_enabled();
}