WordPress at Your Fingertips
function is not described

get_registered_nav_menus() WP 3.0.0

Retrieves all registered navigation menu locations in a theme.

No Hooks.

Return

String[]. Associative array of egistered navigation menu descriptions keyed by their location. If none are registered, an empty array.

Usage

get_registered_nav_menus();

Notes

  • Global. Array. $_wp_registered_nav_menus

Changelog

Since 3.0.0 Introduced.

Code of get_registered_nav_menus() WP 5.8

<?php
function get_registered_nav_menus() {
	global $_wp_registered_nav_menus;
	if ( isset( $_wp_registered_nav_menus ) ) {
		return $_wp_registered_nav_menus;
	}
	return array();
}