Remove Header Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php # -*- coding: utf-8 -*- | |
/* | |
Plugin Name: Remove Header Image | |
Description: Disables the header image for properly written themes like TwentyEleven. | |
Version: 1.0 | |
Required: 3.1 | |
Author: Thomas Scholz | |
Author URI: http://toscho.de | |
License: GPL | |
*/ | |
! defined( 'ABSPATH' ) and exit; | |
add_filter( 'theme_mod_header_image', 'remove_header_image_path', 11 ); | |
function remove_header_image_path() | |
{ | |
return 'remove-header'; | |
} | |
add_action( 'admin_menu', 'remove_header_image_support', 20 ); | |
function remove_header_image_support() | |
{ | |
remove_submenu_page( 'themes.php', 'custom-header' ); | |
// The page is still accessible, so we disable at least uploads. | |
_remove_theme_support( 'custom-header' ); | |
_remove_theme_support( 'custom-header-uploads' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment