On this page
register_nav_menu( string $location, string $description )
Registers a navigation menu location for a theme.
Parameters
$locationstring Required-
Menu location identifier, like a slug.
$descriptionstring Required-
Menu location descriptive text.
More Information
- See register_nav_menus() for creating multiple menus at once.
- This function automatically registers custom menu support for the theme therefore you do not need to call
add_theme_support( 'menus' ); - This function actually works by simply calling register_nav_menus() in the following way:
register_nav_menus( array( $location => $description ) ); - You may use wp_nav_menu() to display your custom menu.
Source
File: wp-includes/nav-menu.php. View all references
function register_nav_menu( $location, $description ) {
register_nav_menus( array( $location => $description ) );
}
Related
Uses
| Uses | Description |
|---|---|
| register_nav_menus() wp-includes/nav-menu.php | Registers navigation menu locations for a theme. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_nav_menu