Automattic\WooCommerce\Internal\Admin\Orders

PageController::register_menu()publicWC 1.0

Registers the "Orders" menu.

Метод класса: PageController{}

No Hooks.

Return

null. Nothing.

Usage

$PageController = new PageController();
$PageController->register_menu(): void;

Code of PageController::register_menu() WC 7.1.0

public function register_menu(): void {
	add_submenu_page(
		'woocommerce',
		__( 'Orders', 'woocommerce' ),
		__( 'Orders', 'woocommerce' ),
		'edit_others_shop_orders',
		'wc-orders',
		array( $this, 'output' )
	);

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