Automattic\WooCommerce\Admin\Features\Navigation

Menu::enqueue_data()publicWC 1.0

Add the menu to the page output.

Method of the class: Menu{}

No Hooks.

Return

Array.

Usage

$Menu = new Menu();
$Menu->enqueue_data( $menu );
$menu(array) (required)
Menu items.

Menu::enqueue_data() code WC 9.0.1

public function enqueue_data( $menu ) {
	$data = array(
		'menuItems'     => array_values( self::get_items() ),
		'rootBackUrl'   => get_dashboard_url(),
	);

	wp_add_inline_script( WC_ADMIN_APP, 'window.wcNavigation = ' . wp_json_encode( $data ), 'before' );
}