wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_get_nav_menu_name › WordPress Function
Since4.9.0
Deprecatedn/a
› wp_get_nav_menu_name ( $location )
Parameters: |
|
Returns: |
|
Defined at: |
|
Codex: |
Returns the name of a navigation menu.
Related Functions: wp_get_nav_menus, wp_get_nav_menu_items, wp_get_nav_menu_object, wp_get_nav_menu_to_edit, wp_setup_nav_menu_item
Source
function wp_get_nav_menu_name( $location ) { $menu_name = ''; $locations = get_nav_menu_locations(); if ( isset( $locations[ $location ] ) ) { $menu = wp_get_nav_menu_object( $locations[ $location ] ); if ( $menu && $menu->name ) { $menu_name = $menu->name; } } /** * Filters the navigation menu name being returned. * * @since 4.9.0 * * @param string $menu_name Menu name. * @param string $location Menu location identifier. */ return apply_filters( 'wp_get_nav_menu_name', $menu_name, $location ); }