has_nav_menu()
has_nav_menu( string $location )
确定注册的导航菜单位置是否分配了菜单。
Determines whether a registered nav menu location has a menu assigned to it.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$location | (string) | 必需 | 菜单位置标识符。 |
返回(Return)
(bool)location是否有菜单。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.0.0 | wp-includes/nav-menu.php:177 | 0 | 4 |
笔记(Notes)
例子
has_nav_menu() 为WP2原创文章,链接:https://www.wp2.cn/functions/has_nav_menu/