Tweak logic responsible for registering COT admin list table.
This commit is contained in:
parent
8b30cf2639
commit
0ecffb416f
|
@ -8,6 +8,7 @@
|
|||
|
||||
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;
|
||||
use Automattic\WooCommerce\Internal\Admin\Orders\ListTable as Custom_Orders_List_Table;
|
||||
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
|
@ -310,15 +311,17 @@ class WC_Admin_Menus {
|
|||
}
|
||||
|
||||
/**
|
||||
* Link to the oder admin list table from the main WooCommerce menu.
|
||||
* Link to the order admin list table from the main WooCommerce menu.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function orders_menu(): void {
|
||||
if ( wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ) {
|
||||
add_submenu_page( 'woocommerce', __( 'Orders', 'woocommerce' ), __( 'Orders', 'woocommerce' ), 'edit_others_shop_orders', 'wc-orders', array( $this, 'orders_page' ) );
|
||||
add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'orders_table' ) );
|
||||
Screen::add_screen( 'wc-orders', 'woocommerce' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set-up the orders admin list table.
|
||||
|
|
Loading…
Reference in New Issue