Closed mathetos closed 10 years ago
Try this: $this->setRootMenuPageBySlug( $w4lmenu );
No luck. That removed the menu completely.
This seems like a bug if it doesn't support the WordPress parameters for creating sub-menus: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
I also just tried commenting out the setRootMenuPage and adding it into the addSubMenuItem, like so:
//$this->setRootMenuPage( ); // create a root page
$this->addSubMenuItem(
array(
'parent_slug' => 'edit.php?post_type=whats_4_lunch',
'title' => 'W4L Settings',
'page_slug' => 'w4l_settings'
)
);
Are you sure you used the setRootMenuPageBySlug()
method, not setRootMenuPage()
since your last posted code is still using setRootMenuPage()
?
Yes, I tried "setRootMenuPageBySlug" and nothing happened, so I kept experimenting.
Of course... now it worked perfect. Perhaps there was a typo when I first tried it. Thanks! Resolved!
Ha, glad it helped! Please close the topic ;)
I wonder if it's hard to close a topic...
Is it possible to define the Root menu item to be a custom post type menu? I tried this and it's not working as I expected: