mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Responsive Images: Currently images are included in the srcset
if the aspect ratio difference is smaller than 0.01
. This number is too high, set it to 0.002
Props joemcgill. Fixes #34810. Built from https://develop.svn.wordpress.org/trunk@35755 git-svn-id: http://core.svn.wordpress.org/trunk@35719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c0f8bd0de2
commit
9b5ffe8062
@ -1061,8 +1061,8 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
|
|||||||
$image_ratio_compare = 0;
|
$image_ratio_compare = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the new ratio differs by less than 0.01, use it.
|
// If the new ratio differs by less than 0.002, use it.
|
||||||
if ( abs( $image_ratio - $image_ratio_compare ) < 0.01 ) {
|
if ( abs( $image_ratio - $image_ratio_compare ) < 0.002 ) {
|
||||||
// Add the URL, descriptor, and value to the sources array to be returned.
|
// Add the URL, descriptor, and value to the sources array to be returned.
|
||||||
$sources[ $image['width'] ] = array(
|
$sources[ $image['width'] ] = array(
|
||||||
'url' => $image_baseurl . $image['file'],
|
'url' => $image_baseurl . $image['file'],
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-RC1-35754';
|
$wp_version = '4.4-RC1-35755';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user