add_menu_page creating own submenu page
-
I’m writing a plugin that adds a top-level menu, along with a set of submenus for it.
I’m adding the pages like this:
add_menu_page('Top Level', 'Top Level', 'read', __FILE__, 'my_admin_overview_function');
add_submenu_page(__FILE__, 'Diagnostics', 'Diagnostics', 'manage_options', 'my_admin_diagnostics', 'my_admin_diagnostics_function');Ideally, this would then produce a submenu to the top-level menu where the first tab is called “Overview”, second tab called “Diagnostics”. However, it seems that the first submenu tab is “Top Level” and there appears to be no way to change this, unless I start fiddling with the
$submenu
variable directly. Is there a better way to do this?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘add_menu_page creating own submenu page’ is closed to new replies.