pre_wp_nav_menu WordPress Filter Hook

The pre_wp_nav_menu hook is called before the nav menu is outputted. It is useful for modifying the menu before it is displayed.

apply_filters( 'pre_wp_nav_menu', string|null $output, stdClass $args ) #

Filters whether to short-circuit the wp_nav_menu() output.


Description

Returning a non-null value from the filter will short-circuit wp_nav_menu(), echoing that value if $args->echo is true, returning that value otherwise.

Top ↑

See also


Top ↑

Parameters

$output

(string|null)Nav menu output to short-circuit with. Default null.

$args

(stdClass)An object containing wp_nav_menu() arguments.


Top ↑

Source

File: wp-includes/nav-menu-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.9.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.