Make WordPress Core

Changeset 22274


Ignore:
Timestamp:
10/23/2012 01:20:40 PM (12 years ago)
Author:
ryan
Message:

Avoid notices in _remove_theme_support(). Props alex-ye, SergeyBiryukov. fixes #22246

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r22132 r22274  
    14651465        case 'custom-header' :
    14661466            $support = get_theme_support( 'custom-header' );
    1467             if ( $support[0]['wp-head-callback'] )
     1467            if ( isset( $support[0]['wp-head-callback'] ) )
    14681468                remove_action( 'wp_head', $support[0]['wp-head-callback'] );
    1469             remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
    1470             unset( $GLOBALS['custom_image_header'] );
     1469            if ( isset( $GLOBALS['custom_image_header'] ) ) {
     1470                remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) );
     1471                unset( $GLOBALS['custom_image_header'] );
     1472            }
    14711473            break;
    14721474
    14731475        case 'custom-background' :
    14741476            $support = get_theme_support( 'custom-background' );
    1475             remove_action( 'wp_head', $support[0]['wp-head-callback'] );
    1476             remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
    1477             unset( $GLOBALS['custom_background'] );
     1477            if ( isset( $support[0]['wp-head-callback'] ) )
     1478                remove_action( 'wp_head', $support[0]['wp-head-callback'] );
     1479            if ( isset( $GLOBALS['custom_background'] ) ) {
     1480                remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) );
     1481                unset( $GLOBALS['custom_background'] );
     1482            }
    14781483            break;
    14791484    }
Note: See TracChangeset for help on using the changeset viewer.