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:
parent
755bece0bb
commit
b6ae99abdb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue