If we have not yet initialized the custom header/background, do not do extra removal in _remove_theme_support(). fixes #22246.

git-svn-id: https://develop.svn.wordpress.org/trunk@22313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-10-26 04:17:25 +00:00
parent 556332cee8
commit 32c92b7a01

View File

@ -1463,6 +1463,8 @@ function _remove_theme_support( $feature ) {
switch ( $feature ) {
case 'custom-header' :
if ( false === did_action( 'wp_loaded', '_custom_header_background_just_in_time' ) )
break;
$support = get_theme_support( 'custom-header' );
if ( $support[0]['wp-head-callback'] )
remove_action( 'wp_head', $support[0]['wp-head-callback'] );
@ -1471,6 +1473,8 @@ function _remove_theme_support( $feature ) {
break;
case 'custom-background' :
if ( false === did_action( 'wp_loaded', '_custom_header_background_just_in_time' ) )
break;
$support = get_theme_support( 'custom-background' );
remove_action( 'wp_head', $support[0]['wp-head-callback'] );
remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );