I created a plugin which creates a menu page that contain 2 sub menus:
function create_menu() {
add_menu_page('Main Page', 'Main Page', 'manage_options', 'main-page', 'main_page_function');
add_submenu_page('main-page', 'First Child', 'First Child', 'manage_options', 'first-page', 'first_child_function');
add_submenu_page('main-page', 'Second Child', 'Second Child', 'manage_options', 'second-page', 'second_child_function');
}
// Actions
add_action('admin_menu', 'create_menu');
On the dashboard I see the main page name "Main Page", When I hover over it or click on it, the other 2 sub menus are not shown.
Why is that?