WC_Admin_Menus::orders_menu()publicWC 1.0

Link to the order admin list table from the main WooCommerce menu.

{} It's a method of the class: WC_Admin_Menus{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Admin_Menus = new WC_Admin_Menus();
$WC_Admin_Menus->orders_menu(): void;

Code of WC_Admin_Menus::orders_menu() WC 6.7.0

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' ) );

		// In some cases (such as if the authoritative order store was changed earlier in the current request) we
		// need an extra step to remove the menu entry for the menu post type.
		add_action(
			'admin_init',
			function () {
				remove_submenu_page( 'woocommerce', 'edit.php?post_type=shop_order' );
			}
		);
	}
}