get_nav_menu_locations()
Retrieves all registered navigation menu locations and the menus assigned to them.
Return
(int[]) Associative array of registered navigation menu IDs keyed by their location name. If none are registered, an empty array.
Source
File: wp-includes/nav-menu.php
function get_nav_menu_locations() {
$locations = get_theme_mod( 'nav_menu_locations' );
return ( is_array( $locations ) ) ? $locations : array();
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |