Ticket #22221: 22221.2.diff

File 22221.2.diff, 1.2 KB (added by nacin, 7 months ago)
  • wp-includes/theme.php

     
    10311031                $data = _get_random_header_data(); 
    10321032        } else { 
    10331033                $data = get_theme_mod( 'header_image_data' ); 
    1034                 if ( ! $data && isset( $_wp_default_headers ) && current_theme_supports( 'custom-header', 'default-image' ) ) { 
     1034                if ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) { 
    10351035                        $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() ); 
    1036                         $default_image = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args ); 
     1036                        $data['url'] = $data['thumbnail_url'] = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args ); 
     1037                        if ( ! empty( $_wp_default_headers ) ) { 
    10371038                        foreach ( (array) $_wp_default_headers as $header => $details ) { 
    10381039                                $url = vsprintf( $details['url'], $directory_args ); 
    1039                                 if ( $default_image == $url ) { 
     1040                                if ( $data['url'] == $url ) { 
    10401041                                        $data = $details; 
    10411042                                        $data['url'] = $url; 
    10421043                                        $data['thumbnail_url'] = vsprintf( $data['thumbnail_url'], $directory_args ); 
    10431044                                        break; 
    10441045                                } 
    10451046                        } 
     1047                        } 
    10461048                } 
    10471049        } 
    10481050