Automattic\WooCommerce\Admin\Features\Navigation

CoreMenu::get_order_menu_items()private staticWC 1.0

Supplies menu items for orders.

This varies depending on whether we are actively using traditional post type-based orders or the new custom table-based orders.

{} Это метод класса: CoreMenu{}

Хуков нет.

Возвращает

?Массив.

Использование

$result = CoreMenu::get_order_menu_items(): ?array;

Код CoreMenu::get_order_menu_items() WC 6.9.4

private static function get_order_menu_items(): ?array {
	if ( ! wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ) {
		return Menu::get_post_type_items( 'shop_order', array( 'parent' => 'woocommerce-orders' ) );
	}

	$main_orders_menu = array(
		'title'      => __( 'Orders', 'woocommerce' ),
		'capability' => 'edit_others_shop_orders',
		'id'         => 'woocommerce-orders-default',
		'url'        => 'admin.php?page=wc-orders',
		'parent'     => 'woocommerce-orders',
	);

	$all_orders_entry          = $main_orders_menu;
	$all_orders_entry['id']    = 'woocommerce-orders-all-items';
	$all_orders_entry['order'] = 10;

	$new_orders_entry          = $main_orders_menu;
	$new_orders_entry['title'] = __( 'Add order', 'woocommerce' );
	$new_orders_entry['id']    = 'woocommerce-orders-add-item';
	$new_orders_entry['url']   = 'admin.php?page=TBD';
	$new_orders_entry['order'] = 20;

	return array(
		'default' => $main_orders_menu,
		'all'     => $all_orders_entry,
		'new'     => $new_orders_entry,
	);
}