Background image support: Fix duplicate output of styling rules#56997
Background image support: Fix duplicate output of styling rules#56997andrewserong merged 1 commit intotrunkfrom
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
|
|
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_filterline 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_filterline 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-imageandbackground-size:coverrules are duplicated.With this PR applied, there should only be one
background-imageandbackground-size:coverrule in the generated markup.Screenshots or screencast
Before
After