WordPress.org

Make WordPress Core

Ticket #34931: srcset_max_diff_ratio.diff

File srcset_max_diff_ratio.diff, 629 bytes (added by mbcreation, 4 years ago)
  • src/wp-includes/media.php

     
    10621062                }
    10631063
    10641064                // If the new ratio differs by less than 0.002, use it.
    1065                 if ( abs( $image_ratio - $image_ratio_compare ) < 0.002 ) {
     1065                if ( abs( $image_ratio - $image_ratio_compare ) < apply_filters( 'max_srcset_image_diff_ratio', 0.002 ) ) {
    10661066                        // Add the URL, descriptor, and value to the sources array to be returned.
    10671067                        $sources[ $image['width'] ] = array(
    10681068                                'url'        => $image_baseurl . $image['file'],