如何从Header
子菜单中删除Background
和Appearance
子页面?
remove_submenu_page
适用于Themes
和Menus
,但我似乎无法找到删除Header
和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' );
答案 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)
remove_custom_background();
已弃用
改为使用remove_theme_support( 'custom-background' );
。