wp_nav_menu_args WordPress Filter Hook

The wp_nav_menu_args hook is used to modify the arguments that are used to generate a navigation menu. This hook is used primarily to change the order of the menu items, but can also be used to change the behavior of how the menu is generated.

apply_filters( 'wp_nav_menu_args', array $args ) #

Filters the arguments used to display a navigation menu.


Description

Top ↑

See also


Top ↑

Parameters

$args

(array)Array of wp_nav_menu() arguments.


Top ↑

More Information

The “wp_nav_menu_args” filter is applied to the arguments of the wp_nav_menu() function before they are processed.

This filter can be used in functions.php of a child theme to add/remove/modify the arguments of a menu defined in the parent theme.

Also, plugins can use this filter to change menus by adding classes/IDs or using a custom walker object.


Top ↑

Source

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

View on Trac



Top ↑

Changelog

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