register_nav_menu

Registers a navigation menu location for a theme.

Description

register_nav_menu( (string) $location, (string) $description ); 

Parameters (2)

0. $location (string)
Menu location identifier, like a slug.
1. $description (string)
Menu location descriptive text.

Usage

  1. if ( !function_exists( 'register_nav_menu' ) ) { 
  2. require_once ABSPATH . WPINC . '/nav-menu.php'; 
  3.  
  4. // Menu location identifier, like a slug. 
  5. $location = ''; 
  6.  
  7. // Menu location descriptive text. 
  8. $description = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = register_nav_menu($location, $description); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/nav-menu.php  
  1. function register_nav_menu( $location, $description ) { 
  2. register_nav_menus( array( $location => $description ) );