wp_nav_menu_items
Filters the HTML list content for navigation menus.
Usage
add_filter( 'wp_nav_menu_items', 'wp_kama_nav_menu_items_filter', 10, 2 ); /** * Function for `wp_nav_menu_items` filter-hook. * * @param string $items The HTML list content for the menu items. * @param stdClass $args An object containing wp_nav_menu() arguments. * * @return string */ function wp_kama_nav_menu_items_filter( $items, $args ){ // filter... return $items; }
- $items(string)
- The HTML list content for the menu items.
- $args(stdClass)
- An object containing wp_nav_menu() arguments.
Changelog
Since 3.0.0 | Introduced. |
Where the hook is called
wp_nav_menu_items
wp-includes/nav-menu-template.php 267
$items = apply_filters( 'wp_nav_menu_items', $items, $args );