mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 23:27:04 +00:00
Responsive images: do not generate srcset for GIFs that are inserted at full size. Prevents breaking animated GIFs.
Props joemcgill. Fixes #34528. git-svn-id: https://develop.svn.wordpress.org/trunk@35524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -983,6 +983,13 @@ function wp_calculate_image_srcset( $image_src, $size_array, $image_meta, $attac
|
||||
return false;
|
||||
}
|
||||
|
||||
// Don't add srcset attributes to (animated) gifs that are inserted at full size.
|
||||
if ( isset( $image_sizes['thumbnail']['mime-type'] ) && 'image/gif' === $image_sizes['thumbnail']['mime-type'] &&
|
||||
false !== strpos( $image_src, $image_meta['file'] ) ) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$image_basename = wp_basename( $image_meta['file'] );
|
||||
$image_baseurl = _wp_upload_dir_baseurl();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user