Make get_the_post_format_image() work when intermediate_image_sizes is empty.

props lancewillett. fixes #24060.

git-svn-id: https://develop.svn.wordpress.org/trunk@24003 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2013-04-16 21:31:37 +00:00
parent 0259c2e13b
commit e1c6e9f2da

View File

@ -2414,16 +2414,18 @@ function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
if ( ! empty( $medias ) ) {
$media = reset( $medias );
$sizes = get_intermediate_image_sizes();
$sizes[] = 'full'; // Add original image source.
$urls = array();
foreach ( $sizes as $size ) {
$image = wp_get_attachment_image_src( $media->ID, $size );
if ( $image ) {
if ( $image )
$urls[] = reset( $image );
$urls[] = get_attachment_link( $media->ID );
}
}
// Add media permalink.
$urls[] = get_attachment_link( $media->ID );
$count = 1;
$matches = array();
$content = $post->post_content;