我正在写一个插件(Github Link) 并且在设置管理菜单的标题时遇到问题。
我用add\\u menu\\u page定义了一个顶部标题菜单(link to code, same as below) 和2个子菜单的add\\u submenu\\u页面,但我在管理菜单中得到4行,主菜单,然后是小菜单中的那一行(具有相同的链接目标),然后是2个子菜单。
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\');
}
我怎样才能更改第二个的标题;“展示画廊”;或者最好将其移除?
谢谢