Make WordPress Core


Ignore:
Timestamp:
04/16/2013 09:31:37 PM (11 years ago)
Author:
markjaquith
Message:

Make get_the_post_format_image() work when intermediate_image_sizes is empty.

props lancewillett. fixes #24060.

File:
1 edited

Legend:

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

    r24000 r24003  
    24152415        $media = reset( $medias );
    24162416        $sizes = get_intermediate_image_sizes();
     2417        $sizes[] = 'full'; // Add original image source.
    24172418
    24182419        $urls = array();
    24192420        foreach ( $sizes as $size ) {
    24202421            $image = wp_get_attachment_image_src( $media->ID, $size );
    2421             if ( $image ) {
     2422            if ( $image )
    24222423                $urls[] = reset( $image );
    2423                 $urls[] = get_attachment_link( $media->ID );
    2424             }
    2425         }
     2424        }
     2425
     2426        // Add media permalink.
     2427        $urls[] = get_attachment_link( $media->ID );
    24262428
    24272429        $count = 1;
Note: See TracChangeset for help on using the changeset viewer.