mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user