WordPress.org

Make WordPress Core

Changeset 22544


Ignore:
Timestamp:
11/11/2012 07:11:27 PM (8 years ago)
Author:
nacin
Message:

Ensure $_wp_default_headers is set before iterating over it in get_custom_header(). props jeffsebring. fixes #22221.

File:
1 edited

Legend:

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

    r22436 r22544  
    10321032    } else {
    10331033        $data = get_theme_mod( 'header_image_data' );
    1034         if ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) {
     1034        if ( ! $data && isset( $_wp_default_headers ) && current_theme_supports( 'custom-header', 'default-image' ) ) {
    10351035            $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() );
    10361036            $default_image = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args );
    1037             foreach ( $_wp_default_headers as $header => $details ) {
     1037            foreach ( (array) $_wp_default_headers as $header => $details ) {
    10381038                $url = vsprintf( $details['url'], $directory_args );
    10391039                if ( $default_image == $url ) {
Note: See TracChangeset for help on using the changeset viewer.