Make WordPress Core

Changeset 20712


Ignore:
Timestamp:
05/03/2012 01:30:55 PM (13 years ago)
Author:
nacin
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r20706 r20712  
    9292        add_action("admin_head-$page", array(&$this, 'take_action'), 50);
    9393        add_action("admin_head-$page", array(&$this, 'js'), 50);
    94         add_action("admin_head-$page", $this->admin_header_callback, 51);
     94        if ( $this->admin_header_callback )
     95            add_action("admin_head-$page", $this->admin_header_callback, 51);
    9596
    9697        add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 );
  • trunk/wp-includes/theme.php

    r20684 r20712  
    13481348
    13491349        $args = get_theme_support( 'custom-header' );
    1350         if ( $args[0]['wp-head-callback'] && $args[0]['admin-head-callback'] ) {
     1350        if ( $args[0]['wp-head-callback'] )
    13511351            add_action( 'wp_head', $args[0]['wp-head-callback'] );
    13521352
    1353             if ( is_admin() ) {
    1354                 require_once( ABSPATH . 'wp-admin/custom-header.php' );
    1355                 $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
    1356             }
     1353        if ( is_admin() ) {
     1354            require_once( ABSPATH . 'wp-admin/custom-header.php' );
     1355            $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] );
    13571356        }
    13581357    }
     
    15581557        $old_theme = wp_get_theme( $stylesheet );
    15591558
    1560        
    15611559        if ( $old_theme->exists() )
    15621560            do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
Note: See TracChangeset for help on using the changeset viewer.