From b6ae99abdb5b27200e3e85eb5c334d751b0a2f68 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Tue, 16 Apr 2013 21:31:37 +0000 Subject: [PATCH] Make get_the_post_format_image() work when intermediate_image_sizes is empty. props lancewillett. fixes #24060. git-svn-id: http://core.svn.wordpress.org/trunk@24003 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 35b2184e3c..2231797765 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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;