Support » Plugins » add_menu_page without root output

  • On the main WP admin sidebar, most root pages don’t show a page for their top element. For example, the last entry is “Settings”, but if you click Settings, the first panel is actually “General”. How can I replicate this with my plugin? I tried omitting the function name in the action hook, but that goes to a completely different page.

Viewing 1 replies (of 1 total)
  • Answer was found on the Administration Menu wiki

    In situations where a plugin is creating its own top-level menu, the first submenu will normally have the same link title as the top-level menu and hence the link will be duplicated. The duplicate link title can be avoided by calling the add_submenu_page function the first time with the parent_slug and menu_slug parameters being given the same value.

    So essentially the add_submenu_page parameters are:

    add_submenu_page('root_page_slug', 'Page Title', 'Menu Title', 'administrator', 'root_page_slug', 'submenu_page_slug');

Viewing 1 replies (of 1 total)
  • The topic ‘add_menu_page without root output’ is closed to new replies.