Make WordPress Core


Ignore:
Timestamp:
01/02/2016 03:52:01 AM (10 years ago)
Author:
dd32
Message:

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.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/media.php

    r35821 r36150  
    10501050        }
    10511051
    1052         // Filter out images that are wider than '$max_srcset_image_width'.
    1053         if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width ) {
     1052        /*
     1053         * Filter out images that are wider than '$max_srcset_image_width' unless
     1054         * that file is in the 'src' attribute.
     1055         */
     1056        if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width &&
     1057            false === strpos( $image_src, $image['file'] ) ) {
     1058
    10541059            continue;
    10551060        }
Note: See TracChangeset for help on using the changeset viewer.