Take a look at the source of the class-walker-nav-menu.php, here.
There you can find the start_el
method and in the commends just before the method saying that the $item
variable is @param WP_Post $item Menu item data object.
. So, it’s a post with post type nav_menu_item
. You can have a look to the wp_setup_nav_menu_item
function (here) which builds up a menu item.
The above is the background. To actually see the contents of an item, you can call
a filter in the start_el
method and print the $item
variable,
e.g.:
function what_the_item( $args, $item, $depth ) {
// pretty print the contents of $item
highlight_string("<?php\n\$item =\n" . var_export($item, true) . ";\n");
// Because this filter will be called way more than one time,
// in order to make the output cleaner, you can stop php execution
// right after the print of the $item so only one $item will be displayed!
// die();
return $args;
}
add_filter( 'nav_menu_item_args', 'what_the_item', 10, 3 );