Do not remove theme presets if defaults are hidden#37008
Merged
Conversation
Member
Author
|
Have some issues in my local environment so couldn't test properly. I'll resume work tomorrow. |
Member
|
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. |
6c33e62 to
45d91ca
Compare
Member
Author
|
Pushed changes to implement this for the top-level, I need to make it work for the block-level as well. |
Member
Author
|
This is ready for review. |
Member
aristath
approved these changes
Dec 9, 2021
noisysocks
pushed a commit
that referenced
this pull request
Dec 13, 2021
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.jsonwill 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.