WordPress at a glance

register_nav_menus() WP 1.0

Registers navigation menu locations for a theme.

  • Global. Array. $_wp_registered_nav_menus
Is the basis for: register_nav_menu()

No Hooks.


Nothing (null).


register_nav_menus( $locations );
Associative array of menu location identifiers (like a slug) and descriptive text.
Default: array()

Code of register nav menus: wp-includes/nav-menu.php VER 5.1.1

function register_nav_menus( $locations = array() ) {
	global $_wp_registered_nav_menus;

	add_theme_support( 'menus' );

	$_wp_registered_nav_menus = array_merge( (array) $_wp_registered_nav_menus, $locations );

Related Functions

From tag: nav menu (nav_menu)

More from category: Other Theme Functions

No comments
    Hello, !     Log In . Register