W3cubDocs

/WordPress

register_nav_menus( array $locations = array() )

Registers navigation menu locations for a theme.

Description

Parameters

$locations

(array) (Optional) Associative array of menu location identifiers (like a slug) and descriptive text.

Default value: array()

Source

File: wp-includes/nav-menu.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 );
}

Changelog

Version Description
3.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_nav_menus