使用remove_submenu_page删除自定义标题子页面

jOp*_*cic 0 wordpress

如何删除HeaderBackground从子页面Appearance的子菜单?

remove_submenu_page很好用ThemesMenus,但我似乎无法找到一种方法来删除HeaderBackground!

这是一个例子:

   // working just fine:
   remove_submenu_page( 'themes.php', 'themes.php' );
   remove_submenu_page( 'themes.php', 'nav-menus.php' ); 
   // not working:
   remove_submenu_page( 'themes.php', 'themes.php?page=custom-header' ); 
   remove_submenu_page( 'themes.php', 'themes.php?page=custom-background' ); 
Run Code Online (Sandbox Code Playgroud)

Dat*_*rad 5

在主题的function.php中使用以下代码

add_action( 'after_setup_theme','remove_twentyeleven_options', 100 );
function remove_twentyeleven_options() {

remove_custom_background();
remove_custom_image_header();

}
Run Code Online (Sandbox Code Playgroud)