0

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.

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

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.