Automattic\WooCommerce\Admin\Features\Navigation

CoreMenu::get_categories()public staticWC 1.0

Get all menu categories.

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

No Hooks.

Return

Array.

Usage

$result = CoreMenu::get_categories();

Code of CoreMenu::get_categories() WC 7.1.0

public static function get_categories() {
	$analytics_enabled = Features::is_enabled( 'analytics' );
	return array(
		array(
			'title' => __( 'Orders', 'woocommerce' ),
			'id'    => 'woocommerce-orders',
			'badge' => self::get_shop_order_count(),
			'order' => 10,
		),
		array(
			'title' => __( 'Products', 'woocommerce' ),
			'id'    => 'woocommerce-products',
			'order' => 20,
		),
		$analytics_enabled ?
			array(
				'title' => __( 'Analytics', 'woocommerce' ),
				'id'    => 'woocommerce-analytics',
				'order' => 30,
			) : null,
		$analytics_enabled ?
			array(
				'title'  => __( 'Reports', 'woocommerce' ),
				'id'     => 'woocommerce-reports',
				'parent' => 'woocommerce-analytics',
				'order'  => 200,
			) : null,
		array(
			'title' => __( 'Marketing', 'woocommerce' ),
			'id'    => 'woocommerce-marketing',
			'order' => 40,
		),
		array(
			'title'  => __( 'Settings', 'woocommerce' ),
			'id'     => 'woocommerce-settings',
			'menuId' => 'secondary',
			'order'  => 20,
			'url'    => 'admin.php?page=wc-settings',
		),
		array(
			'title'  => __( 'Tools', 'woocommerce' ),
			'id'     => 'woocommerce-tools',
			'menuId' => 'secondary',
			'order'  => 30,
		),
	);
}