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.

Return

Nothing (null).

Usage

register_nav_menus( $locations );
$locations(array)
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.0.1

<?php
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