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
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
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |