I'm trying to create my own custom menu using the Walker class and in the process of trying to figure out what's going on, I'm attempting to reproduce what wp_nav_menu() does by default, so, I've got this:
class My_Admin_Walker extends Walker
{
public $db_fields = array ('parent' => 'parent', 'id' => 'menu_id');
}
function my_admin( ){
//$list = wp_nav_menu( array( 'walker' => new My_Admin_Walker() ));//produces no output
//$list = wp_nav_menu();//outputs links to pages
return $list;
}
my_admin();
When I pass my own My_Admin_Walker
class to wp_nav_menu
it produces no output. So I think I need to set the required $db_fields
to something. The Walker docs say:
The value of each key should be the names of the object properties that hold the parent id and item id, respectively.
But I'm stuck on figuring out what the $db_fields
should be set to, to produce the default output or any other output. I've tried field names in the wp database but had no luck so far. Where do I look up these object properties it's talking about?
Thanks for any help!