mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
Make admin-head-callback optional for custom headers. Reverts part of [20684]. fixes #20603.
git-svn-id: http://core.svn.wordpress.org/trunk@20712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ea0172254
commit
15b661ecab
@ -91,7 +91,8 @@ class Custom_Image_Header {
|
||||
add_action("admin_head-$page", array(&$this, 'help') );
|
||||
add_action("admin_head-$page", array(&$this, 'take_action'), 50);
|
||||
add_action("admin_head-$page", array(&$this, 'js'), 50);
|
||||
add_action("admin_head-$page", $this->admin_header_callback, 51);
|
||||
if ( $this->admin_header_callback )
|
||||
add_action("admin_head-$page", $this->admin_header_callback, 51);
|
||||
|
||||
add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
|
||||
add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) );
|
||||
|
@ -1347,13 +1347,12 @@ 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'] && $args[0]['admin-head-callback'] ) {
|
||||
if ( $args[0]['wp-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'] );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1557,7 +1556,6 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user