wp_get_nav_menu_name
Filters the navigation menu name being returned.
Usage
add_filter( 'wp_get_nav_menu_name', 'wp_kama_get_nav_menu_name_filter', 10, 2 ); /** * Function for `wp_get_nav_menu_name` filter-hook. * * @param string $menu_name Menu name. * @param string $location Menu location identifier. * * @return string */ function wp_kama_get_nav_menu_name_filter( $menu_name, $location ){ // filter... return $menu_name; }
- $menu_name(string)
- Menu name.
- $location(string)
- Menu location identifier.
Changelog
Since 4.9.0 | Introduced. |
Where the hook is called
wp_get_nav_menu_name
wp-includes/nav-menu.php 227
return apply_filters( 'wp_get_nav_menu_name', $menu_name, $location );