-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add editor-gradient-presets to get_theme_support #17841
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,12 @@ function gutenberg_experiments_editor_settings( $settings ) { | |
'__experimentalEnableFullSiteEditing' => gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing' ), | ||
|
||
); | ||
|
||
$gradient_presets = current( (array) get_theme_support( '__experimental-editor-gradient-presets' ) ); | ||
if ( false !== $gradient_presets ) { | ||
$experiments_settings['gradients'] = $gradient_presets; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a problem where KSES rules in multi-sites remove spacing from gradients and then make the block look invalid. I guess we need to process the gradient values against our KSES function that removes the spaces, before setting it as setting, so even if devs pass values with space the spacing is removed. If we prefer to solve this issue in a follow up PR, I guess we should update our samples to not include the spaces. |
||
} | ||
|
||
return array_merge( $settings, $experiments_settings ); | ||
} | ||
add_filter( 'block_editor_settings', 'gutenberg_experiments_editor_settings' ); |
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.
Any particular reason to keep this as experimental for now? When do you think we should make it stable?