How to access Item->ID in custom walker
-
I am working on building a custom Walker_Nav_Menu class for use in wp_nav_menu(). My issue is that I need to gain access to the $item->ID in start_lvl(), the same way you would in start_el().
function start_lvl( &$output, $depth, $args ) { // You can not access $item here because it is not passed as an argument } function start_el(&$output, $item, $depth, $args) { // You can access $item here }
I am trying to pull metadata information for each menu item using its ID. I have seen a couple other threads where people have asked similar questions but I have not found a working answer.
Any help would be much appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to access Item->ID in custom walker’ is closed to new replies.