函数原型
get_nav_menu_locations(): int[]
函数描述
Retrieves all registered navigation menu locations and the menus assigned to them.
是否弃用
未弃用
函数参数
无
函数返回值
int[] Associative array of registered navigation menu IDs keyed by their location name. If none are registered, an empty array.
函数位置
File: wp-includes/nav-menu.php.
函数源码
function get_nav_menu_locations() {
$locations = get_theme_mod( 'nav_menu_locations' );
return ( is_array( $locations ) ) ? $locations : array();
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

