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
This commit is contained in:
Mark Jaquith 2013-04-16 21:31:37 +00:00
parent 755bece0bb
commit b6ae99abdb
1 changed files with 5 additions and 3 deletions

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;