1

I guess this question is more or less about aesthetics and organization rather than functionality, but I'm curious nonetheless...

I know I can add a custom menu item in the dashboard for my plugin using the add_menu_page() function, but my question is: Is it possible to add a "master" menu item with "sub-menu" items which would correlate to individual plugin options pages?

In other words, let's say my company name is "Guru Guy" and I have released 4 different plugins... Would it be possible to create a menu item that looked something like this:

Guru Guy <-- Main menu item

-- Plugin 1 <-- Plugin 1's options page link

-- Plugin 2 <-- Plugin 2's options page link

-- Plugin 3 <-- Plugin 3's options page link

-- Plugin 4 <-- Plugin 4's options page link

1

Yes,

http://codex.wordpress.org/Administration_Menus

Specific to your question add_submenu_page: http://codex.wordpress.org/Function_Reference/add_submenu_page

  • I guess I'm not explaining it thoroughly enough. I understand how to create a submenu item, but my question is if it's possible to have each submenu item under a single parent menu item be related to completely different plugins... Rather than several submenu items related to the same plugin and it's options. – Nero_DCLXVI Oct 22 '11 at 23:19
  • 1
    Yes the function parameter allows it to be anything you want, its basically just a blank page. – Wyck Oct 22 '11 at 23:28
  • I see, so it seems then that the most difficult part would be checking to see if the parent menu already exists upon plugin activation, as well as checking for the installation of the other plugins which would be listed as submenu items. – Nero_DCLXVI Oct 22 '11 at 23:36
  • yes exactly , for example using is_plugin_active but this is more a question on how you structure your system. – Wyck Oct 23 '11 at 0:22

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.