WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get registered nav menus

This page is marked as incomplete. You can help Codex by expanding it.

Contents

Description

Returns an array of all registered navigation menus in a theme

Usage

<?php get_registered_nav_menus(); ?>

Parameters

Does not accept any parameters

Return Values

(array) 
All registered navigation menus in a theme.

The keys are the locations, while the values are the descriptions. See register_nav_menus.

Examples

Display a simple list of the menus:

<?php

$menus = get_registered_nav_menus();

foreach ( $menus as $location => $description ) {

	echo $location . ': ' . $description . '<br />';
}

Notes

Change Log

Since: 3.0.0

Source File

get_registered_nav_menus() is located in wp-includes/nav-menu.php

Related