I am writing a plugin (Github Link) and have trouble setting up the titles of the admin menu.
I defined a top header menu with add_menu_page (link to code, same as below) and 2 children with add_submenu_page, but I get 4 lines in the Admin menu, the main one, then that one again (with the same link target) in small and then the 2 children.
add_action('admin_menu', 'unc_gallery_admin_menu');
function unc_gallery_admin_menu() {
// the main page where we manage the options
add_menu_page(
'Uncovery Gallery Options', // $page_title,
'Uncovery Gallery', // $menu_title,
'manage_options', // $capability,
'unc_gallery_admin_menu', // $menu_slug,
'unc_gallery_options' // $function, $icon_url, $position
);
// where we upload images
$upload_page_hook_suffix = add_submenu_page(
'unc_gallery_admin_menu', // $parent_slug
'Upload Images', // $page_title
'Upload Images', // $menu_title
'manage_options', // capability, manage_options is the default
'unc_gallery_admin_upload', // menu_slug
'unc_uploads_form' // function
);
add_action('admin_print_scripts-' . $upload_page_hook_suffix, 'unc_gallery_admin_add_css_and_js');
// where we list up all the images
$view_page_hook_suffix = add_submenu_page(
'unc_gallery_admin_menu', // $parent_slug
'View Images', // $page_title
'View Images', // $menu_title
'manage_options', // capability, manage_options is the default
'unc_gallery_admin_view', // menu_slug
'unc_gallery_admin_display_images' // function
);
add_action('admin_print_scripts-' . $view_page_hook_suffix, 'unc_gallery_admin_add_css_and_js');
}
How can I either change the title of the 2nd "Uncovery Gallery" or preferably remove it?
thanks!