[wp-trac] [WordPress Trac] #35108: Responsive images blurry - srcset attribute doesn't include full size version
WordPress Trac
noreply at wordpress.org
Tue Dec 15 22:04:05 UTC 2015
#35108: Responsive images blurry - srcset attribute doesn't include full size
version
-----------------------------+------------------------------
Reporter: nicasi | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Thumbnails | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by SergeyBiryukov):
Hi @nicasi, welcome to Trac! Thanks for the report.
> srcset doenst include full size version, widest version included is
1024px version
There's a [source:tags/4.4/src/wp-includes/media.php#L1028
max_srcset_image_width] filter for the maximum image width to be included
in a `srcset` attribute.
The default maximum width is 1600 pixels. If your images are wider, you
could increase it to 2000 with this code:
{{{
/**
* Increase the maximum image width to be included in a 'srcset'
attribute.
*
* @param int $max_width The maximum image width to be included in the
'srcset'. Default '1600'.
* @return int Filtered maximum image width.
*/
function wp35108_increase_max_srcset_image_width( $max_width ) {
return 2000;
}
add_filter( 'max_srcset_image_width',
'wp35108_increase_max_srcset_image_width' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35108#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list