-
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
FSE: Allow themes to opt in to wp-block-styles using theme.json #40097
Conversation
'text' => null, | ||
), | ||
'custom' => null, | ||
'defaultBlockStyles' => null, |
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 the only change. Should I just add this to the array in the construct?
* One of 'default', 'theme', or 'custom'. Default 'theme'. | ||
*/ | ||
public function __construct( $theme_json = array(), $origin = 'theme' ) { | ||
parent::__construct( $theme_json, $origin ); |
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.
I'm not sure why we don't do this more?
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 works well for me using Archeo, I can see the wp-block-styles
styles.
Should we update the theme.json schema to include defaultBlockStyles
at the same time?
Yes good idea. Updated! |
We decided that 37255 is not the right approach, so this isn't needed. |
What?
This allows themes to enable the
wp-block-styles
theme support using theme.json rather than callingadd_theme_support
in functions.php.Why?
Themes shouldn't need to use PHP.
How?
I've had to overload a few things inside
WP_Theme_JSON_Gutenberg
. I think this stuff might need to be in a 6.1 directory unless this lands soon.Testing Instructions
cc @WordPress/block-themers
Fixes #37255