WordPress.org

Make WordPress Core

Changeset 20684


Ignore:
Timestamp:
05/02/2012 03:16:48 PM (8 years ago)
Author:
nacin
Message:

Require both wp-head-callback and admin-head-callback for custom header theme support. fixes #20603.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r20642 r20684  
    30233023 * @param callback $admin_preview_callback Output a custom header image div on the custom header administration screen. Optional.
    30243024 */
    3025 function add_custom_image_header( $wp_head_callback = '', $admin_head_callback = '', $admin_preview_callback = '' ) {
     3025function add_custom_image_header( $wp_head_callback, $admin_head_callback, $admin_preview_callback = '' ) {
    30263026    _deprecated_function( __FUNCTION__, '3.4', 'add_theme_support( \'custom-header\', $args )' );
    3027     $args = array();
    3028     if ( $wp_head_callback )
    3029         $args['wp-head-callback'] = $wp_head_callback;
    3030     if ( $admin_head_callback )
    3031         $args['admin-head-callback'] = $admin_head_callback;
     3027    $args = array(
     3028        'wp-head-callback'    => $wp_head_callback,
     3029        'admin-head-callback' => $admin_head_callback,
     3030    );
    30323031    if ( $admin_preview_callback )
    30333032        $args['admin-preview-callback'] = $admin_preview_callback;
  • trunk/wp-includes/theme.php

    r20642 r20684  
    13481348
    13491349        $args = get_theme_support( 'custom-header' );
    1350         if ( $args[0]['wp-head-callback'] )
     1350        if ( $args[0]['wp-head-callback'] && $args[0]['admin-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'] );
     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            }
    13561357        }
    13571358    }
     
    15571558        $old_theme = wp_get_theme( $stylesheet );
    15581559
     1560       
    15591561        if ( $old_theme->exists() )
    15601562            do_action( 'after_switch_theme', $old_theme->get('Name'), $old_theme );
Note: See TracChangeset for help on using the changeset viewer.