get_registered_nav_menus(): string[]
Retrieves all registered navigation menu locations in a theme.
Return
string[] Associative array of registered navigation menu descriptions keyed by their location. If none are registered, an empty array.
Source
File: wp-includes/nav-menu.php
.
View all references
function get_registered_nav_menus() {
global $_wp_registered_nav_menus;
if ( isset( $_wp_registered_nav_menus ) ) {
return $_wp_registered_nav_menus;
}
return array();
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Display a simple list of the menus
I think this should say “Returns an array of all registered navigation menus in active theme”, as current wording sounds like you can use this function on other themes (which is what I’m currently looking for)
Sample return value: