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`.

Merges [36110] to the 4.4 branch.
Props joemcgill.
Fixes #35108.

Built from https://develop.svn.wordpress.org/branches/4.4@36150


git-svn-id: http://core.svn.wordpress.org/branches/4.4@36116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-01-02 03:53:22 +00:00
parent fd22afea0c
commit b2da9c0fd4
2 changed files with 8 additions and 3 deletions

View File

@ -1049,8 +1049,13 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
continue; 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; continue;
} }

View File

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