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

Do not remove theme presets if defaults are hidden #37008

Merged
merged 7 commits into from
Dec 9, 2021

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Nov 30, 2021

In #36772 we made it so that theme presets with the same slug as a default preset will be removed.

In doing so, we missed one case that was brought up by @chthonic-ds: when the defaults are disabled by the theme, we still need to show all theme presets, whether or not they have the same slug as a default one.

By doing this, we also make sure that themes with no theme.json will see no changes (defaults are disabled for them unless they opt-in), and they'll have the same number of presets values they had before the introduction of default presets.

@oandregal oandregal self-assigned this Nov 30, 2021
@oandregal oandregal added [Type] Bug An existing feature does not function as intended Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 30, 2021
@oandregal
Copy link
Member Author

Have some issues in my local environment so couldn't test properly. I'll resume work tomorrow.

@oandregal oandregal added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] In Progress Tracking issues with work in progress labels Nov 30, 2021
@ndiego
Copy link
Member

ndiego commented Dec 5, 2021

Chiming in here. If the default color palette is disabled, it would make sense that themes should have free reign to enable any colors they like. Otherwise, it locks out a fair number of color slugs.

@oandregal oandregal force-pushed the update/do-not-remove-theme-colors-if-no-defaults branch from 6c33e62 to 45d91ca Compare December 7, 2021 16:10
@oandregal
Copy link
Member Author

Pushed changes to implement this for the top-level, I need to make it work for the block-level as well.

@oandregal oandregal removed the [Status] In Progress Tracking issues with work in progress label Dec 7, 2021
@oandregal oandregal marked this pull request as ready for review December 7, 2021 17:13
@oandregal
Copy link
Member Author

This is ready for review.

@ndiego
Copy link
Member

ndiego commented Dec 7, 2021

I can confirm that this works as expected. Thanks!

image

@oandregal oandregal merged commit fa37c89 into trunk Dec 9, 2021
@oandregal oandregal deleted the update/do-not-remove-theme-colors-if-no-defaults branch December 9, 2021 11:57
@github-actions github-actions bot added this to the Gutenberg 12.2 milestone Dec 9, 2021
@ndiego ndiego restored the update/do-not-remove-theme-colors-if-no-defaults branch December 9, 2021 17:33
@noisysocks noisysocks deleted the update/do-not-remove-theme-colors-if-no-defaults branch December 13, 2021 01:00
@noisysocks noisysocks removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants