Make WordPress Core


Ignore:
Timestamp:
06/04/2012 02:43:19 PM (12 years ago)
Author:
ryan
Message:

Back compat for bundled themes. Props nacin, SergeyBiryukov, kobenland. fixes #20768

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r20973 r20983  
    102102    // The custom header business starts here.
    103103
    104     add_theme_support( 'custom-header', array(
     104    $custom_header_support = array(
    105105        // The default image to use.
    106106        // The %s is a placeholder for the theme template directory URI.
     
    115115        // Callback for styling the header preview in the admin.
    116116        'admin-head-callback' => 'twentyten_admin_header_style',
    117     ) );
     117    );
     118   
     119    add_theme_support( 'custom-header', $custom_header_support );
     120   
     121    if ( ! function_exists( 'get_custom_header' ) ) {
     122        // This is all for compatibility with versions of WordPress prior to 3.4.
     123        define( 'HEADER_TEXTCOLOR', '' );
     124        define( 'NO_HEADER_TEXT', true );
     125        define( 'HEADER_IMAGE', $custom_header_support['default-image'] );
     126        define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
     127        define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
     128        add_custom_image_header( '', $custom_header_support['admin-head-callback'] );
     129        add_custom_background();
     130    }
    118131
    119132    // We'll be using post thumbnails for custom header images on posts and pages.
    120133    // We want them to be 940 pixels wide by 198 pixels tall.
    121134    // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
    122     set_post_thumbnail_size( get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ), true );
     135    set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
    123136
    124137    // ... and thus ends the custom header business.
Note: See TracChangeset for help on using the changeset viewer.