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,6 +91,7 @@ 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);
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 );

View File

@ -1347,7 +1347,7 @@ 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() ) {
@ -1355,7 +1355,6 @@ function _custom_header_background_just_in_time() {
$custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
}
}
}
if ( current_theme_supports( 'custom-background' ) ) {
// In case any constants were defined after an add_custom_background() call, re-run.
@ -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