Take the 2-minute tour ×
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.

http://codex.wordpress.org/Function_Reference/wp_get_nav_menu_items

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); 

or

<?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
add comment

1 Answer

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>';
    var_dump($obj);
    echo <'/pre>';
}

Usage

say i want to see what wp_get_nav_menu_items actually returns:

$menu_items = wp_get_nav_menu_items($menu->term_id); 
var_dump_pre($menu_items);
share|improve this answer
add comment

Your Answer

 
discard

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.