Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/wp-includes/post-thumbnail-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
}

$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
$html = wp_image_use_alternate_mime_types( $html, 'post_thumbnail_html', $post_thumbnail_id );

/**
* Fires after fetching the post thumbnail HTML.
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/tests/post/thumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function test_get_the_post_thumbnail() {
'class' => 'attachment-post-thumbnail size-post-thumbnail wp-post-image',
)
);
$expected = wp_image_use_alternate_mime_types( $expected, 'post_thumbnail_html', self::$attachment_id );

$this->assertSame( $expected, get_the_post_thumbnail( self::$post ) );

Expand Down Expand Up @@ -194,6 +195,7 @@ public function test_the_post_thumbnail() {
'class' => 'attachment-post-thumbnail size-post-thumbnail wp-post-image',
)
);
$expected = wp_image_use_alternate_mime_types( $expected, 'post_thumbnail_html', self::$attachment_id );

$this->expectOutputString( $expected );
the_post_thumbnail();
Expand Down