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

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

Changelog

VersionDescription
3.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.