has_nav_menu

过滤钩子


apply_filters( 'has_nav_menu', $has_nav_menu, $location )
参数
  • (bool)
    $has_nav_menu
    Whether there is a menu assigned to a location.
    Required:
  • (string)
    $location
    Menu location.
    Required:
定义位置
  • wp-includes/nav-menu.php
    , line 195
引入
4.3.0
弃用

Filters whether a nav menu is assigned to the specified location.

return apply_filters( 'has_nav_menu', $has_nav_menu, $location );