WordPress at a glance

get_nav_menu_locations() WP 1.0

Works based on: get_theme_mod()
Basis of: has_nav_menu()
1 time — 0.000063 sec (very fast) | 50000 times — 1 sec (very fast)

No Hooks.

Return

Array. Registered navigation menu locations and the menus assigned them. If none are registered, an empty array.

Usage

get_nav_menu_locations();

Changelog

Since 3.0.0 Introduced.

Code of get_nav_menu_locations() WP 5.7.2

<?php
function get_nav_menu_locations() {
	$locations = get_theme_mod( 'nav_menu_locations' );
	return ( is_array( $locations ) ) ? $locations : array();
}

From tag: nav menu (nav_menu)

More from category: Menu

No comments
    Log In