[wp-trac] [WordPress Trac] #36154: wp_calculate_image_srcset() filters out square resized feature image
WordPress Trac
noreply at wordpress.org
Mon Mar 7 22:16:26 UTC 2016
#36154: wp_calculate_image_srcset() filters out square resized feature image
--------------------------+------------------------
Reporter: solo14000 | Owner: joemcgill
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Media | Version: 4.4.2
Severity: normal | Resolution: invalid
Keywords: | Focuses:
--------------------------+------------------------
Changes (by joemcgill):
* status: reviewing => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
Replying to [comment:2 solo14000]:
> Hi @joemcgill,
>
> I did not pay attention that wp_caculate_image_srcset() is handling
image resized set having only the same aspect ratio as the original. May
be the WP documentation is a quite too short or I do not know much about
the srcset attribute specification.
Thanks for the explanation @solo14000. I'll add a note to the Code
Reference site at https://developer.wordpress.org/reference/.
If you're attempting to switch image aspect ratios based on viewport
width, I would suggest looking into some custom markup utilizing the
`<picture>` element, which is more suited to that use case than `srcset`
alone.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36154#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list