Make admin-head-callback optional for custom headers. Reverts part of [20684]. fixes #20603.

git-svn-id: https://develop.svn.wordpress.org/trunk@20712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-05-03 13:30:55 +00:00
parent 1d35a7b1db
commit dd57074aed
2 changed files with 6 additions and 7 deletions

View File

@ -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' ) );

View File

@ -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