Conversation
luisherranz
left a comment
There was a problem hiding this comment.
Reproduced the problem on a fresh installation and confirmed that this PR solves it.
Thanks, Sérgio!
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thank you for the review, @luisherranz! 👍 |
Co-authored-by: sgomes <sergiomdgomes@git.wordpress.org> Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: b9d2d1a |
What?
The image block currently generates the lightbox
srcsetwithout specifying a$sizeparameter towp_get_attachment_image_srcset. This means that the$sizeparameter defaults to'medium', per the method signature.This PR changes that, to specify a larger size.
Why?
Some systems, like WordPress.com, rely on the
$sizeparameter to determine the range of sizes to include in thesrcset, to avoid including excessively large ones. In this case, since we're talking about a lightbox, the size that we're defaulting to ('medium') is not adequate, which leads to blurry images being shown, due to a lack of higher resolution options in the resultingsrcset.How?
This PR passes in an array with the image dimensions, when the image size is known. This ensures that the image can get displayed at the best possible resolution in the lightbox.
When the image size is unknown, it defaults to
'large'instead.Testing Instructions
srcseton the image in the lightboxTesting Instructions for Keyboard
See the above instructions, but instead of clicking the image to open the lightbox, move focus to the image and hit the spacebar instead.