I’ve added custom menus to the admin menu in the backend, and I almost always have sub pages, but is it possible to have a 3rd level of page, or “sub sub menu pages”?
Snippet of code:
add_action('admin_menu',array(new mmr_menu((isset($_GET['page']) ? $_GET['page'] : "mmr")),'mk_menu'));
class mmr_menu{
public function mk_menu(){
add_menu_page('MMR', 'MMR', 'administrator', PLUGIN_PREFIX.'mmr', array(&$this,'get_page'), PLUGIN_DIR.'inc/images/logo.gif');
add_submenu_page(PLUGIN_PREFIX.'mmr', PLUGIN_PREFIX.'app_and_reg', 'Applications & Registrations', 'administrator', PLUGIN_PREFIX.'app_and_reg', array(&$this,"get_page"));
// Doesn't work
add_submenu_page(PLUGIN_PREFIX.'app_and_reg', PLUGIN_PREFIX.'payment_reports', 'Payments', 'administrator', PLUGIN_PREFIX.'payment_reports', array(&$this,"get_page"));
}
}
PLUGIN_PREFIX
and PLUGIN_DIR
are defines, and mmr_menu->get_page()
is a public method that I didn’t think was necessary to include.
Usually plugin authors create tabs for 3rd level pages. These are not registered as seperate pages, but you can add a query arg to select the page, and link to the different tabs that way.
Example:
Having said that, some wordpress frameworks (link piklist) have support for 3rd level tabs built in