has_nav_menu WordPress Filter Hook

The has_nav_menu WordPress hook is used to determine whether a given location has a registered menu. This is useful for determining whether to display a particular menu in a given location.

apply_filters( 'has_nav_menu', bool $has_nav_menu, string $location ) #

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


Parameters

$has_nav_menu

(bool)Whether there is a menu assigned to a location.

$location

(string)Menu location.


Top ↑

Source

File: wp-includes/nav-menu.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.