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.


Top ↑

Source

File: wp-includes/class-walker-nav-menu.php

View on Trac



Top ↑

Changelog

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