Repository navigation
Block Supports: Add PHP helpers for block support classes and styles - #14094
Draft
aaronrobertshaw wants to merge 2 commits into
Draft
aaronrobertshaw wants to merge 2 commits into
aaronrobertshaw wants to merge 2 commits into
Conversation
Adds a background.backgroundClip block support, so a block can set which box its background is painted into: border-box, padding-box, content-box, or the text itself. Clipping to the text is what gives blocks a gradient text fill. Registers the property in the style engine and theme.json, allows the declarations through KSES, and skips the has-background class when the background is clipped to the text. Props aaronrobertshaw. See #66094.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
This was referenced Oct 8, 2026
aaronrobertshaw
force-pushed
the
backport/php-support-style-helpers
branch
from
October 8, 2026 13:22
74ea201 to
a4d85e7
Compare
aaronrobertshaw
force-pushed
the
backport/php-support-style-helpers
branch
from
October 8, 2026 14:07
a4d85e7 to
fee7818
Compare
28 of 77 tasks
Author
|
I've been held up on some other priorities so this one will now be aimed for WP 7.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of Gutenberg PRs
Trac ticket: https://core.trac.wordpress.org/ticket/66269
Adds PHP helpers that turn block attributes into a block support's classes and styles, like the JS
get*ClassesAndStyles()functions, and moves the block supports onto them.This PR backports:
wp_get_border_classes_and_styles(),wp_get_shadow_classes_and_styles(),wp_get_spacing_classes_and_styles(),wp_get_color_classes_and_styles()andwp_get_background_classes_and_styles(),wp_apply_border_support(),wp_apply_shadow_support(),wp_apply_spacing_support(),wp_apply_colors_support()andwp_render_background_support()built on them,The block changes that call these helpers (Avatar, Post Featured Image, Icon, Post Navigation Link, Navigation Submenu, Comment Author Avatar, Calendar and Button) arrive later with the Gutenberg package update.
Dependency: #13491 (background clip). This branch is based on it, so it shows that commit until #13491 merges.
Testing instructions
The block support output should be identical to #13491 on its own. To compare, register a dynamic test block and render it on each branch:
Both branches output:
Use of AI
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: the port from Gutenberg and the tests; I reviewed and edited them.