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

Backport defaultDuotone changes #2526

Closed

Conversation

ajlende
Copy link

@ajlende ajlende commented Apr 7, 2022

This PR backports the defaultDuotone option changes from WordPress/gutenberg#38681 and WordPress/gutenberg#39966 in the Gutenberg plugin.

The changes didn't make it into a 5.9.x release, so are being moved in WordPress/gutenberg#40123. Wait for that PR to land before committing these changes.

Gutenberg tracking issue: WordPress/gutenberg#39889

Trac ticket: https://core.trac.wordpress.org/ticket/55505


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

* - properties => array of CSS properties to be used by kses to
* validate the content of each preset
* by means of the remove_insecure_properties method.
* - path => Where to find the preset within the settings section.
Copy link
Member

@oandregal oandregal Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file are also being backported at #2534 If this lands later, this file can be ignored.

@@ -208,6 +208,9 @@ public static function get_theme_data( $deprecated = array() ) {
$default_gradients = true;
}
$theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;

// Classic themes without a theme.json don't support global duotone.
$theme_support_data['settings']['color']['defaultDuotone'] = false;
Copy link
Member

@oandregal oandregal Apr 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These is being backported at #2534 If this one lands later, this file can be ignored.

Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done testing to verify that this PR sets the settings.__experimentalFeatures.color.defaultDuotone value in the core/block-editor store appropriately:

  • Theme with theme.json that doesn't set any defaultDuotone (I've used twentytwentytwo): it's set to true as expected.
  • Theme with theme.json that sets a false value for defaultDuotone (I've used twentytwentytwo): it's set to false as expected.
  • Theme without theme.json (I've used twentytwentyone): it's set to false as expected.

Note that this doesn't have any effect on the UI until the npm packages are released, which use the value of this setting to enable/disable UI.

@oandregal
Copy link
Member

oandregal commented Apr 11, 2022

The changes didn't make it into a 5.9.x release, so are being moved in WordPress/gutenberg#40123. Wait for that PR to land before committing these changes.

Despite being marked as "draft", this PR is ready to land. The gutenberg changes this depended upon are already merged.

Timezones are working against us in this particular PR, as Alex hasn't yet started his day and couldn't mark this PR as ready yet.

@gziolo gziolo marked this pull request as ready for review April 11, 2022 09:59
@gziolo
Copy link
Member

gziolo commented Apr 11, 2022

The missing changes were committed in https://core.trac.wordpress.org/changeset/53130. We needed only changes to the theme.json file. Everything else was already in the trunk as pointed out by @oandregal 💯

@gziolo gziolo closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants