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



nav_menu_item_id › WordPress Filter Hooks

Since4.1.0
Deprecatedn/a
apply_filters( 'nav_menu_item_id', 'menu-item-' . $menu_item->ID, $menu_item, $args, $depth )
Parameters: (4)
  • (string) $menu_item_id The ID attribute applied to the menu item's `<li>` element.
    Required: Yes
  • (WP_Post) $menu_item The current menu item.
    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 ID attribute applied to a menu item's list item element.





Source

$id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $menu_item->ID, $menu_item, $args, $depth );