Skip to content

Commit

Permalink
force jpg version of vimeo images
Browse files Browse the repository at this point in the history
  • Loading branch information
tw2113 committed Jun 25, 2021
1 parent 2ab87f0 commit 54bfb10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion automatic-featured-images-from-videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ function wds_get_vimeo_details( $vimeo_id ) {
$vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $vimeo_id ) . '.json' );
if ( 200 === wp_remote_retrieve_response_code( $vimeo_data ) ) {
$response = json_decode( $vimeo_data['body'] );
$video['video_thumbnail_url'] = isset( $response[0]->thumbnail_large ) ? $response[0]->thumbnail_large : false;
// For the moment, we will force jpg since WebP is still iffy.
$video['video_thumbnail_url'] = isset( $response[0]->thumbnail_large ) ? $response[0]->thumbnail_large . '.jpg' : false;
$video['video_url'] = $response[0]->url;
$video['video_embed_url'] = 'https://player.vimeo.com/video/' . $vimeo_id;
}
Expand Down

0 comments on commit 54bfb10

Please sign in to comment.