wp_nav_menu_objects filter-hookWP 3.1.0

Filters the sorted list of menu item objects before generating the menu's HTML.

Usage

add_filter( 'wp_nav_menu_objects', 'wp_kama_nav_menu_objects_filter', 10, 2 );

/**
 * Function for `wp_nav_menu_objects` filter-hook.
 * 
 * @param array    $sorted_menu_items The menu items, sorted by each menu item's menu order.
 * @param stdClass $args              An object containing wp_nav_menu() arguments.
 *
 * @return array
 */
function wp_kama_nav_menu_objects_filter( $sorted_menu_items, $args ){

	// filter...
	return $sorted_menu_items;
}
$sorted_menu_items(array)
The menu items, sorted by each menu item's menu order.
$args(stdClass)
An object containing wp_nav_menu() arguments.

Changelog

Since 3.1.0 Introduced.

Where the hook is called

wp_nav_menu()
wp_nav_menu_objects
wp-includes/nav-menu-template.php 226
$sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );

Where the hook is used in WordPress

Usage not found.