Filters (and actions) need to be declared with the number of arguments accepted by the callback; it is the fourth parameter of add_filter() (default 1):
add_filter( 'nav_menu_item_args', 'filter_nav_menu_item_args', 10, 3 );
function filter_nav_menu_item_args( $args, $item, $depth ) {
print_r( $item );
return $args;
}
Related Posts:
- Third level navigation class
- Add a counter beside menu item label
- Dynamically exclude menu items from wp_nav_menu
- remove specific classes from menu items
- Add custom link on the fly to nav menu
- Possible to append class to nav menu added to widget area?
- display cart information within li of cart menu item
- Show thumbnail to category items in wp_nav_menu(), how?
- How to modify menu text in callback function of ‘walker_nav_menu_start_el’ hook
- Displaying a Custom Avatar in WP Bootstrap Navwalker Menus in WordPress
- Add button and title on submenu WordPress
- Programmatically add a Navigation menu and menu items
- Show current navigation path from menu
- Call custom field into menu item
- Exclude Private, Draft pages from Primary Nav when using custom menu
- wp_nav_menu always falls back to a menu
- wp_get_nav_menu_items how to exclude sub level menu items?
- Add custom attributes to menu items without plugin
- How to apply a class to the second word in menu list item?
- Not able to get current menu ID
- Add class to active top level (grandparent) menu item
- How to get Menu Navigation Labels to output HTML
- custom menu not found
- wp_nav_menu doesn’t generate parent/ancestor classes
- Hide and show menu subpages
- How to add a parameter to links in the nav menu?
- Benefits of using Nav Walker?
- display only the wp_nav_menu, which has the current-menu-item
- Use walker for specific menu, or avoid use of walker
- Change where navigation bar links?
- Page-Linking Structure
- has_children in custom nav_walker
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How to fix “Supplied nav_menu_item value missing property” after update to WordPress 5.0
- How to add #navbar to all page links?
- wp_nav_menu including Skype URL
- Hook for number of items in Appearance > Menus > CustomPostType > View All [duplicate]
- add span to top level links of a wordpress menu called “main”
- How to have two menus using Bootstrap nav walker?
- Menu item added in wp_nav_menu_items filter is never highlighted
- Change an li class name in a wordpress custom menu walker
- Debugging – trying to add search box to menus
- Separator for custom nav menu
- How do I add recent posts to the menu?
- Conditional secondary menus
- Making a navigation header menu with bulma, need some advice
- Nav and logo loading each time causing menu to move JointsWP – Foundation 6
- Help with walker for nav
- Prevent menu from loading in a page template [duplicate]
- Hide menu from homepage
- wp_nav_menu action/filter help
- add_filter for where statment issue
- Trying to add a custom social icon to a Twenty Twenty-One child theme
- Adding toggle-able element after menu item
- Custom register_taxonomy ins’t showing custom Nav menu
- Conditional menus based on page title
- How to test if a specific page is the front page?
- Style wp_link_pages as a select drop down list
- How to add columns to wordpress menu editor
- how to insert data in li tag of navigation
- Mobile navigation is shown, but standard navigation does not disappear
- Output Post ID for all nav_items
- changing the labels inside appearance -> menus for some for the fields
- if role is logged in then do something
- WP Menu Rollover Nav Item and Effect DIV Elsewhere
- How to change the navigation menu
- Add/remove image from navigation bar
- WordPress nav_menu items from another menu appearing
- How can I order these pages in this navigation bar on this old wordpress theme?
- WordPress Menu Navigation links not working
- Modifying Woocommerce menu based on tags and categories
- Where to place a svg chevron down in my custom walker?
- How to apply individual menu item’s “CSS Classes” to , not ?
- Add href to tag in nav menu for mobile
- Output existing wp_nav_menu with a custom walker
- Sub-Items Not Visible in Navigation
- Why does WordPress convert absolute URLs to relative URLs for menu items?
- How can I create this menu with wp_nav_menu()?
- Unable to remove page from primary menu
- Show navigation header menu by post and categery
- How to Use Default Auto-Generated Menu?
- wp-nav menu with custom walker , how to remove a tag if it has any submenu
- Menu Details Output in Javascript [closed]
- Custom location for menu
- Avoid changing menu query with suppress_filters => false
- wp_nav_menu() reutrns HTTPS?
- Determine if a navigation item has children
- wordpress superfish dropdown menu
- Unable to edit Navigation bar
- Display Username as parent menu item
- Site pages show the page title under navigation bar
- Navigation menu, remove item from desktop
- Wrapping my ‘s with
- How to add a class directly on a unordered list element that is a primary navigation
- How do I programatically remove Menus?
- Get_avatar filter hook not displaying custom avatar image on frontend
- Is there a way to make it so that I don’t get a hamburger menu, but rather a desktop style nav, when resizing to a mobile size
- Give custom class names to WP nav sub-menu
- How to get and set post meta for core/navigation-link?
- How to get the navigation menu items? [closed]