Make WordPress Core


Ignore:
Timestamp:
12/28/2015 02:28:53 AM (9 years ago)
Author:
azaozz
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.

Props joemcgill.
Fixes #35108 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r36031 r36110  
    10471047        }
    10481048
    1049         // Filter out images that are wider than '$max_srcset_image_width'.
    1050         if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width ) {
     1049        /*
     1050         * Filter out images that are wider than '$max_srcset_image_width' unless
     1051         * that file is in the 'src' attribute.
     1052         */
     1053        if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width &&
     1054            false === strpos( $image_src, $image['file'] ) ) {
     1055
    10511056            continue;
    10521057        }
Note: See TracChangeset for help on using the changeset viewer.