Skip to content
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

Merged

Conversation

@spacedmonkey
Copy link
Contributor

spacedmonkey commented Oct 8, 2019

Description

Fixes #17774

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
@swissspidy

This comment has been minimized.

Copy link
Member

swissspidy commented Oct 8, 2019

@spacedmonkey

This comment has been minimized.

Copy link
Contributor Author

spacedmonkey commented Oct 8, 2019

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.

Copy link
Member

jorgefilipecosta left a comment

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;

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Oct 21, 2019

Member

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.

lib/experiments-page.php Outdated Show resolved Hide resolved
@karmatosed karmatosed added this to Inbox in Tightening Up Oct 22, 2019
@karmatosed karmatosed moved this from Inbox to Ready to create in Tightening Up Oct 22, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the spacedmonkey:feature/php-gradient-api branch from 0725e4b to a7d4bea Nov 1, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the spacedmonkey:feature/php-gradient-api branch from a7d4bea to 49fdd89 Nov 1, 2019
@jorgefilipecosta

This comment has been minimized.

Copy link
Member

jorgefilipecosta commented Nov 1, 2019

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 👍

@jorgefilipecosta jorgefilipecosta merged commit 85b0729 into WordPress:master Nov 1, 2019
4 of 7 checks passed
4 of 7 checks passed
pull-request-automation
Details
Header rules - gutenberg-playground No header rules processed
Details
Pages changed - gutenberg-playground All files already uploaded
Details
Redirect rules - gutenberg-playground No redirect rules processed
Details
Mixed content - gutenberg-playground No mixed content detected
Details
Travis CI - Pull Request Build Passed
Details
netlify/gutenberg-playground/deploy-preview Deploy preview ready!
Details
daniloercoli added a commit that referenced this pull request Nov 5, 2019
…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)
  ...
@karmatosed karmatosed moved this from Ready to create to Done in Tightening Up Nov 6, 2019
@spacedmonkey

This comment has been minimized.

Copy link
Contributor Author

spacedmonkey commented Nov 7, 2019

Thanks for the feedback. Great to see this merged!

@youknowriad youknowriad added this to the Gutenberg 6.9 milestone Nov 11, 2019
CreativeDive added a commit to CreativeDive/gutenberg that referenced this pull request Nov 12, 2019
* Add editor-gradient-presets to get_theme_support

* Add docs.

* Fixed docs

* Document slug property; Make the API experimental.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.