wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_nav_menu_locations › WordPress Function

Since3.0.0
已弃用n/a
get_nav_menu_locations ( 没有参数 )
返回:
  • (int[]) Associative array of registered navigation menu IDs keyed by their location name. If none are registered, an empty array.
定义在:
文档:

Retrieves all registered navigation menu locations and the menus assigned to them.



源码

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