-
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
Add editor-gradient-presets to get_theme_support #17841
Conversation
Let's add this to the Theme Support documentation, in the same manner as the color palettes docs: |
@swissspidy I have made a pass at docs. But I am not sure we should continue with docs, until the api is design is complete. |
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.
Hi @spacedmonkey, thank you for submitting this PR 👍 I left some comments, but generally, it seems to be in the right direction and can be merged when the comments are addressed.
|
||
$gradient_presets = current( (array) get_theme_support( '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 comment
The 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.
PR fixing the problem here for default gradients here: #17940
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.
0725e4b
to
a7d4bea
Compare
a7d4bea
to
49fdd89
Compare
I added a small commit that applies the suggestions. I think we can merge this PR and continue the work. If there is any comment on the last changes, we can update the things in a follow-up PR. Thank you for submitting this PR @spacedmonkey 👍 |
…rnmobile/gb-mobile-872-JSApplicationIllegalArgumentException-in-RCTAztecView * 'master' of https://github.com/WordPress/gutenberg: (56 commits) Update: Default gradients. (#18214) Fix: setting a preset color on pullquote default style makes the block invalid (#18194) Fix default featured image size (#15844) Fix postmeta radio regression. (#18183) Components: Switch screen-reader-text to VisuallyHidden (#18165) [rnmobile] Release 1.16.0 to master (#18261) Template Loader: Add theme block template resolution. (#18247) Add a README file for storybook directory (#18245) Add editor-gradient-presets to get_theme_support (#17841) Add "Image Title Attribute" as an editable attribute on the image block (#11070) enables horizontal movers in social blocks (#18234) [RNMobile] Add mobile Spacer component (#17896) Add experimental `ResponsiveBlockControl` component (#16790) Fix mover for floats. (#18230) Rename Component to WPComponent in docstring (#18226) Colors Selector: replace `Aa` text by SVG icon (#18222) Removed gif from README (#18200) makes the submenu items stacked vertically (#18221) Add block navigator to sidebar panel for nav block (#18202) Fix: consecutive updates may trigger a blocks reset (#18219) ...
Thanks for the feedback. Great to see this merged! |
|
||
```php | ||
add_theme_support( | ||
'__experimental-editor-gradient-presets', |
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?
Description
Fixes #17774
Checklist: