Require both wp-head-callback and admin-head-callback for custom header theme support. fixes #20603.

git-svn-id: https://develop.svn.wordpress.org/trunk@20684 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-05-02 15:16:48 +00:00
parent fa3427a99a
commit bf5decbacf
2 changed files with 11 additions and 10 deletions

View File

@@ -1347,12 +1347,13 @@ function _custom_header_background_just_in_time() {
add_theme_support( 'custom-header', array( '__jit' => true ) );
$args = get_theme_support( 'custom-header' );
if ( $args[0]['wp-head-callback'] )
if ( $args[0]['wp-head-callback'] && $args[0]['admin-head-callback'] ) {
add_action( 'wp_head', $args[0]['wp-head-callback'] );
if ( is_admin() ) {
require_once( ABSPATH . 'wp-admin/custom-header.php' );
$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
if ( is_admin() ) {
require_once( ABSPATH . 'wp-admin/custom-header.php' );
$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
}
}
}
@@ -1556,6 +1557,7 @@ function check_theme_switched() {
if ( $stylesheet = get_option( 'theme_switched' ) ) {
$old_theme = wp_get_theme( $stylesheet );
if ( $old_theme->exists() )
do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
else