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.
What?
The PR adds theme supports for border settings.
Update: This core patch has been committed https://core.trac.wordpress.org/ticket/58598
Replaces #47675
Alternative to #47451
Related:
Matching core ticket and patch: https://core.trac.wordpress.org/ticket/58598
core 57460 Backport: appearance-tools theme_support
core 56487 Bundled themes: opt-in to appearance tools
Why?
There is no way for themes to enable border settings without theme.json (Theme.json can not be added to all classic themes without friction).
How?
Adds a conditional check, and if the theme or plugin adds add_theme_support( 'border' ); enables the setting in the block editor.
Testing Instructions
Activate a classic theme.
Open the themes functions.php and locate a setup function or similar that uses
add_action( 'after_setup_theme',
.For example if you are using Twenty Twenty-One, look for the function called
twenty_twenty_one_setup()
Add
add_theme_support( 'border' );
inside that function.Open the block editor.
Add a block that supports borders, for example, a group.
Confirm that the border controls are available.
Palette colors will not work on the front, that is a separate issue: a classic theme needs to add CSS to support using its custom palette for the borders. Adding this will be up to each theme developer.