get_nav_menu_locations

函数


get_nav_menu_locations ( No parameters )
返回值
  • (int[]) Associative array of registered navigation menu IDs keyed by their location name. If none are registered, an empty array.
定义位置
  • wp-includes/nav-menu.php
    , line 165
引入
3.0.0
弃用

检索所有注册的导航菜单位置和分配给它们的菜单。

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