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

时间:2013-07-15 07:22:36

标签: wordpress

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

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

2 个答案:

答案 0 :(得分:5)

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

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

remove_custom_background();
remove_custom_image_header();

}

答案 1 :(得分:2)

自WordPress 3.4起,

remove_custom_background();已弃用

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