Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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); 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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