使用add_submenu_page 相反
<?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); ?>
$parent_slug
应为以下内容之一
For Dashboard: add_submenu_page( \'index.php\', ... ); Also see add_dashboard_page()
For Posts: add_submenu_page( \'edit.php\', ... ); Also see Also see add_posts_page()
For Media: add_submenu_page( \'upload.php\', ... ); Also see add_media_page()
For Links: add_submenu_page( \'link-manager.php\', ... ); Also see add_links_page()
For Pages: add_submenu_page( \'edit.php?post_type=page\', ... ); Also see add_pages_page()
For Comments: add_submenu_page( \'edit-comments.php\', ... ); Also see add_comments_page()
For Custom Post Types: add_submenu_page( \'edit.php?post_type=your_post_type\', ... );
For Appearance: add_submenu_page( \'themes.php\', ... ); Also see add_theme_page()
For Plugins: add_submenu_page( \'plugins.php\', ... ); Also see add_plugins_page()
For Users: add_submenu_page( \'users.php\', ... ); Also see add_users_page()
For Tools: add_submenu_page( \'tools.php\', ... ); Also see add_management_page()
For Settings: add_submenu_page( \'options-general.php\', ... ); Also see add_options_page()
示例:
add_submenu_page( \'tools.php\', \'My Custom Submenu Page\', \'My Custom Submenu Page\', \'manage_options\', \'my-custom-submenu-page\', \'my_custom_submenu_page_callback\' );