nav_menu_item_args WordPress Filter Hook
The nav_menu_item_args hook allows you to modify the arguments passed to the wp_nav_menu_item function. This can be useful for changing the behavior of the menu item, such as changing the link URL or adding a custom class.
apply_filters( 'nav_menu_item_args', stdClass $args , WP_Post $menu_item , int $depth ) #
Filters the arguments for a single nav menu item.
Parameters
- $args
(stdClass)An object of wp_nav_menu() arguments.
- $menu_item
(WP_Post)Menu item data object.
- $depth
(int)Depth of menu item. Used for padding.
Source
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |