-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix: Allow themes to disable the color and gradients palette. #32225
Fix: Allow themes to disable the color and gradients palette. #32225
Conversation
Size Change: 0 B Total Size: 1.86 MB ℹ️ View Unchanged
|
This would also fix #32027 (added to the issue description so it auto-closes the issue when this lands). |
@@ -1119,13 +1126,41 @@ public function merge( $incoming, $update_or_remove = 'remove' ) { | |||
} | |||
foreach ( $to_append as $path_to_append ) { | |||
$path = array_merge( $metadata['path'], $path_to_append ); | |||
$incoming_node = _wp_array_get( $incoming_data, $path, array() ); | |||
$incoming_node = _wp_array_get( $incoming_data, $path, null ); |
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.
I think we can simply remove the 3rd argument here... $default
is already null
in the function.
$incoming_node = _wp_array_get( $incoming_data, $path, null ); | |
$incoming_node = _wp_array_get( $incoming_data, $path ); |
// If we are merging with something that has no values | ||
// core origin should be treated as if the values were present | ||
// and we can remove the origin. |
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.
I believe we no longer want to use we
phrasing in inline docs...
// If we are merging with something that has no values | |
// core origin should be treated as if the values were present | |
// and we can remove the origin. | |
// If merging with something that has no values, | |
// core origin should be treated as if the values were present | |
// and the origin can be removed. |
@jorgefilipecosta my understanding was that we were exploring #32358 as an alternative to this one? |
This PR is superseded by #32358. |
Fixes #32027
This PR fixes a regression and now themes can disable again the color and gradients palette.
How has this been tested?
Using a thtme.json.
I did not configure any color palette and verified that the default core colors appear when the editor loads.
I set an empty color palette and verified the no color palette appears on the editor.
I repeated the test on theme without theme.json using the theme supports mechanism.