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

Core palette can no longer be overridden from PHP #36489

Closed
steveangstrom opened this issue Nov 15, 2021 · 5 comments · Fixed by #36496
Closed

Core palette can no longer be overridden from PHP #36489

steveangstrom opened this issue Nov 15, 2021 · 5 comments · Fixed by #36496
Labels
[Type] Regression Related to a regression in the latest release

Comments

@steveangstrom
Copy link

Description

Setting brand colours no longer works in gutenberg it's working fine in WP 5.8.2 it is not working in Gutenberg Version 11.9.0

Core colours can no longer be removed.

Removing "core" colours is VITAL for branded corporate sites.

PHP support is VITAL for established sites and those being developed away from your bleeding edge

Step-by-step reproduction instructions

METHOD

in PHP enter this in a theme functions.php

function sc_custom_gutenberg_custom_color_palette() { add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'Light Text', 'sc' ), 'slug' => 'light-text', 'color' => '#FFFFFF', ), array( 'name' => __( 'Darker Text', 'sc' ), 'slug' => 'darker-text', 'color' => '#535353', ), array( 'name' => __( 'Amaranth', 'sc' ), 'slug' => 'main-amaranth', 'color' => '#E23448', ), ) ); } add_action( 'after_setup_theme', 'sc_custom_gutenberg_custom_color_palette', 20 );

the editor will continue to show the awful "core" colours + the new array

Screenshots, screen recording, code snippet

WP 5.8.2 core - colours can be set correctly

core-cols-override-wp-582

Gutenberg Version 11.9.0 - awful colours persist
gut-col-disaster

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@steveangstrom
Copy link
Author

The issue is not present in Version 11.8.3

Rolling back to Version 11.8.3 on problem websites temporarily masks the issue and hides "core" palettes until a more acceptable resolution is found.

@steveangstrom steveangstrom changed the title Core pallete can no longer be overridden from PHP Core palette can no longer be overridden from PHP Nov 15, 2021
@fabiankaegy
Copy link
Member

@steveangstrom the fix hat was done in #36492 only applies to theme.json.

I suppose you could probably filter the editor settings like so:

add_filter(
	'block_editor_settings_all',
	'remove_core_color_palette_support_from_editor_settings'
);

/**
 * This function removes the Core Palette and Gradients fron the Color Pickers
 *
 * @param array $settings block editor settings
 */
function remove_core_color_palette_support_from_editor_settings( $settings ) {
	$settings['color']['corePalette'] = false;
	$settings['color']['coreGradients'] = false;
	return $settings;
}

I haven't tested it though.

@steveangstrom
Copy link
Author

steveangstrom commented Nov 15, 2021

No, that does not work

WP 5.8.2
Gutenberg 11.9
added filter above

RESULT
color-fail

The very major problem I have with Gutenberg and all recent WP development is this casual attitude to real world commercial sites.
This feature is relatively recently introduced:
https://make.wordpress.org/core/2020/01/23/controlling-the-block-editor/

many commercial site creators like me follow those docs, we've delivering sites in the last 18 months trying to keep up with this shifting unstable pile of features.
Now we have a bleeding edge assumption that everyone is running json themes, which are barely even LAUNCHED.

Please stop treating PHP as some kind of niche afterthought PHP is not legacy, it is the basis of 99% of sites running WP.

This feverish JS fetish Gutenberg community is an ivory tower academic bubble and it makes me furious as everyone pats themselves on the back for theoretical successes - as I'm constantly trying to deliver real world sites and the foundations are shifting every week.

please. Gutenberg Devs. Look at the CMS corporate site community and consider us just a little bit, I am absolutely begging you, for gods sake.

@steveangstrom
Copy link
Author

steveangstrom commented Nov 26, 2021

This is NOT FIXED in Gutenberg 12.0.1

Current status. No theme.json. Colours defined in functions.php. Palette is a still mess on all sites using Gutenberg.

Sites on 12.0.1 are broken as shown below. I assume the only "fix" is to roll back to Gutenberg 11.8.3

INCORRECT (Gutenberg 12.0.1)
Screenshot 2021-11-26 at 00-01-00 Add New Page ‹ Sitename — WordPress

CORRECT ( rolled back to 11.8.3)
Screenshot 2021-11-26 at 00-26-43 Edit Page ‹ Sitename — WordPress

@oandregal
Copy link
Member

Hey Steve, the patch that hides the core palette for themes with no theme.json by default is going to be part of Gutenberg 12.1 which is a few days away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants