wpseek.com
A WordPress-centric search engine for devs and theme authors



nav_menu_item_attributes › WordPress Filter Hooks

Since6.3.0
Deprecatedn/a
apply_filters( 'nav_menu_item_attributes', $li_atts, $menu_item, $args, $depth )
Parameters: (4)
  • (array) $li_atts { The HTML attributes applied to the menu item's `<li>` element, empty strings are ignored. @type string $class HTML CSS class attribute. @type string $id HTML id attribute. }
    Required: Yes
  • (WP_Post) $menu_item The current menu item object.
    Required: Yes
  • (stdClass) $args An object of wp_nav_menu() arguments.
    Required: Yes
  • (int) $depth Depth of menu item. Used for padding.
    Required: Yes
Defined at:
Codex:

Filters the HTML attributes applied to a menu's list item element.





Source

$li_atts       = apply_filters( 'nav_menu_item_attributes', $li_atts, $menu_item, $args, $depth );