-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix post featured image scaling on the front #46838
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @carolinan, thank you for fixing this issue 👍
I left some comments that I think we need to address before the merge but other than that, the PR looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this issue @carolinan!
It tests well for me when:
- setting various combinations of explicit or relative widths
- adding borders, including a radius
- adding an overlay
After adding the safecss_filter_attr
calls, it looks like we have a couple of redundant esc_attr
calls now that we can clean up. After that, this should be good to go, nice work ✨
Editor | Frontend |
---|---|
Flaky tests detected in 7aa8a0c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3880242668
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tweaks @carolinan 👍
This is still testing well for me, and the code looks good. Nice work!
What?
In the block editor, the post featured image
<figure>
wrapper has a set height. This height was missing on the front, so the image did not look the same in the editor and front.This pr adds the height to the front, both to the
<figure>
and the<a>
which is used when the image is linked.Closes #42322
Why?
The image did not look the same in the editor and front when image height and scaling was set in the block settings.
How?
Updates index.php and adds the height to the
get_block_wrapper_attributes
and the<a>
when applicable.Testing Instructions
When testing this we need to take extra care to make sure that the border and border radius settings still work.
The featured image should have a 100% height and "scale" set to cover, and stretch the height of the content.
Save and view the front. Confirm that the image looks the same on the front.
Continue to test the remaining settings. Confirm that the image looks correct on the front for each step.
For example:
Testing Instructions for Keyboard
Screenshots or screencast