Responsive images: when creating srcset do not exclude the image size which is in the src attribute even when it is larger than max_srcset_image_width.

Props joemcgill.
Fixes #35108 for trunk.
Built from https://develop.svn.wordpress.org/trunk@36110


git-svn-id: http://core.svn.wordpress.org/trunk@36075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-12-28 02:29:28 +00:00
parent eefe6b0779
commit 698b825760
2 changed files with 8 additions and 3 deletions

View File

@ -1046,8 +1046,13 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
continue;
}
// Filter out images that are wider than '$max_srcset_image_width'.
if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width ) {
/*
* Filter out images that are wider than '$max_srcset_image_width' unless
* that file is in the 'src' attribute.
*/
if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width &&
false === strpos( $image_src, $image['file'] ) ) {
continue;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36108';
$wp_version = '4.5-alpha-36110';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.