apply_filters( 'wp_nav_menu_args', array $args )

Filters the arguments used to display a navigation menu.

Description

See also

Parameters

$args

(array) Array of wp_nav_menu() arguments.

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.

Source

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

View on Trac

Changelog

Version Description
3.0.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_nav_menu_args