[wp-hackers] Hello, new developer with a question

Viper007Bond viper at viper007bond.com
Sat Nov 17 22:32:28 GMT 2007


add_menu_page() does indeed add a child with the same name and it can be
rather annoying.

I have a ticket open on the matter: http://trac.wordpress.org/ticket/5100

Meanwhile, you could probably "fix" this by modifying the $submenu array.

On 11/17/07, Callum Macdonald <lists.automattic.com at callum-macdonald.com>
wrote:
>
> Hey Derek,
>
> I'm pretty sure add_menu_page() doesn't add a child page. So you could
> simply add a child page with the same page name and function, but a
> different title.
>
> However, if it does add a child page automatically, hook into the
> 'admin_menu' action and manually edit the $menu and $submenu variables.
> You can see how they're structured in wp-admin/menu.php - it's pretty
> straightforward.
>
> Cheers,
>
>
> Callum.
>
> Derek Hogue wrote:
> > Hey all,
> >
> > I'm just wrapping up work on my first WP plug-in, but there's one
> > thing I can't figure out.
> >
> > I'm adding a top-level menu (as I have 5 child pages), but what I'd
> > love to do is have the top-level menu name and the corresponding
> > sub-level menu name be different - in the same way that clicking on
> > "Write" takes you to the sub-menu called "Write Post".
> >
> > Is this doable within the plug-in API? Any ideas or help would be grand.
> >
> > I've searched around, but can't find any discussion of this online or
> > in the archives of this list.
> >
> > Thanks!
> > Derek
> > --
> > http://amphibian.info
> >
> >
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> >
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/


More information about the wp-hackers mailing list