-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Background image support: Fix duplicate output of styling rules #56997
Background image support: Fix duplicate output of styling rules #56997
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/block-supports/background.php |
Flaky tests detected in 783771e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7189603410
|
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 quick review! |
✅ I updated this PR with the |
What?
Part of #54336
Fix duplicate output of background image styling rules for the Group block.
Why?
As of WP 6.4, the background image block support exists in core as well as in the Gutenberg plugin. Unlike the other block supports, in Gutenberg, we were missing the
remove_filter
line to switch off the core behaviour if present, to prioritise the Gutenberg behaviour and allow further development of the block support within the plugin.How?
remove_filter
line to disable core's callback for the background support if presentTesting Instructions
Test with WP 6.4+
Prior to applying this PR, add a post or page with a Group block and set a background image for it. Save and view the site frontend, and inspect the generated markup — notice that the
background-image
andbackground-size:cover
rules are duplicated.With this PR applied, there should only be one
background-image
andbackground-size:cover
rule in the generated markup.Screenshots or screencast
Before
After