Connect new list table with WC Admin nav.

This commit is contained in:
barryhughes 2022-05-05 19:07:46 +00:00
parent e27b89a7e8
commit 8b30cf2639
2 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,7 @@
* @version 2.5.0
*/
use Automattic\WooCommerce\Admin\Features\Navigation\Screen;
use Automattic\WooCommerce\Internal\Admin\Orders\ListTable as Custom_Orders_List_Table;
defined( 'ABSPATH' ) || exit;
@ -316,6 +317,7 @@ class WC_Admin_Menus {
public function orders_menu(): void {
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' );
}
/**

View File

@ -134,6 +134,16 @@ wc_admin_connect_page(
)
);
// WooCommerce > Orders (COT)
wc_admin_connect_page(
array(
'id' => 'woocommerce-orders',
'screen_id' => 'woocommerce_page_wc-orders',
'title' => __( 'Orders', 'woocommerce' ),
'path' => 'admin.php?page=wc-orders',
)
);
// WooCommerce > Orders > Add New.
wc_admin_connect_page(
array(