Skip to content

Instantly share code, notes, and snippets.

@adrianduffell
Created August 8, 2022 05:59
Show Gist options
  • Save adrianduffell/57c1e2ad97c7cb120dbacba02e4f5d77 to your computer and use it in GitHub Desktop.
Save adrianduffell/57c1e2ad97c7cb120dbacba02e4f5d77 to your computer and use it in GitHub Desktop.
WooCommerce Enable COT
<?php
/**
* Plugin Name: WooCommerce Enable COT
* Description: Adds the code to enable Custom Order Tables.
* Version: 0.0.1
*/
function enable_cot(){
$order_controller = wc_get_container()
->get('Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController');
if( isset( $order_controller ) ) {
$order_controller->show_feature();
}
}
add_action( 'init', 'enable_cot', 99 );
@adrianduffell
Copy link
Author

This should no longer be used as it results in the warning:

Notice: Function CustomOrdersTableController::show_feature was called incorrectly. CustomOrdersTableController::show_feature: The visibility of the custom orders table feature is now handled by the WooCommerce features engine. See the FeaturesController class, or go to WooCommerce - Settings - Advanced - Features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment