-
Notifications
You must be signed in to change notification settings - Fork 133
Use modern image formats in background images for Cover blocks and Group blocks #2121
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
Conversation
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #2121 +/- ##
==========================================
+ Coverage 67.22% 67.69% +0.47%
==========================================
Files 93 93
Lines 7758 7845 +87
==========================================
+ Hits 5215 5311 +96
+ Misses 2543 2534 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 working on this!
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.
This is getting close! The main thing left, other than the two minor suggestions I left, is to add PHPUnit tests for this new webp_uploads_filter_block_background_images()
function.
Thanks @westonruter for the detailed review. I'll add the test cases and update the PR. 🙇 |
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.
Some micro nits to reduce extra newlines where they don't seem needed.
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.
Thank you!
Summary
Fixes #2111
Relevant technical choices
Adds functionality to process background images used in Cover and Group blocks, particularly for cases with special styling options like fixed or repetitive backgrounds. Our current approach was limited to only processing
<img>
tags in content, but this missed background images applied through inline CSS styles.When users set specific styling options in Cover blocks (such as fixed backgrounds) or Group blocks with background images, these images are added via inline styles rather than standard
<img>
tags. As a result, these images weren't being converted to modern formats.