Make WordPress Core

Ticket #25156: 25156.2.diff

File 25156.2.diff, 1.1 KB (added by kovshenin, 12 years ago)
  • src/wp-includes/theme.php

     
    897897function get_header_image() {
    898898        $url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
    899899
    900         if ( 'remove-header' == $url )
     900        if ( 'remove-header' == $url || ( ! is_random_header_image() && empty( $url ) ) )
    901901                return false;
    902902
    903903        if ( is_random_header_image() )
     
    10361036 *
    10371037 * @since 3.4.0
    10381038 *
    1039  * @return object
     1039 * @return mixed False if there is no header, or an object with the properties
     1040 *      'url', 'thumbnail_url', 'width', and 'height'.
    10401041 */
    10411042function get_custom_header() {
    10421043        global $_wp_default_headers;
    10431044
    1044         if ( is_random_header_image() ) {
     1045        $url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
     1046
     1047        if ( 'remove-header' == $url || ( ! is_random_header_image() && empty( $url ) ) ) {
     1048                return false;
     1049        } elseif ( is_random_header_image() ) {
    10451050                $data = _get_random_header_data();
    10461051        } else {
    10471052                $data = get_theme_mod( 'header_image_data' );