Hi I am building a menu using the code listed here.


Is there a way to suss out the menu hierarchy. As i can not debug this, it is difficult for me to see what wp_get_nav_menu_items actually returns.

$menu_items = wp_get_nav_menu_items($menu->term_id); 


<?php $items = wp_get_nav_menu_items($menu, $args = array()); ?> 

Is there a listing that describes the objects returned via wordpress functions?

Any help much appreciated.


Whenever i find myself not sure what kind of data is returned by a function i use my simple ready made var_dump_pre() function which i use heavily in developments, simply paste it in your theme's functions.php file.

function var_dump_pre($obj){
    echo '<pre>';
    echo <'/pre>';


say i want to see what wp_get_nav_menu_items actually returns:

$menu_items = wp_get_nav_menu_items($menu->term_id); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.