0

如何从子菜单中删除Header和子页面?BackgroundAppearance

remove_submenu_pageThemes与and一起使用效果很好Menus,但我似乎找不到删除Headerand的方法Background

这是一个例子:

   // 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' ); 
4

2 回答 2

5

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

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

remove_custom_background();
remove_custom_image_header();

}
于 2013-07-15T09:32:58.030 回答
3

remove_custom_background();自 WordPress 3.4 起已弃用

改为使用remove_theme_support( 'custom-background' );

于 2014-10-21T14:48:12.190 回答