wp_nav_menu_(menu_slug)_items
Filters the HTML list content for a specific navigation menu.
Usage
add_filter( 'wp_nav_menu_(menu_slug)_items', 'wp_kama_nav_menu_slug_items_filter', 10, 2 ); /** * Function for `wp_nav_menu_(menu_slug)_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_slug_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_(menu_slug)_items
wp-includes/nav-menu-template.php 278
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );