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

Fix: Color formatter appears when color choosing is not possible #20222

Conversation

jorgefilipecosta
Copy link
Member

Fix: #20205

This PR makes sure we don't show the color formatter if the user has no colors to choose from.

How has this been tested?

I used the custom color formatter and added some colors to a paragraph and saved the post.
I added this code to the functions.php section of the currently enabled theme:

function set_colors() {
	add_theme_support( 'editor-color-palette', array() );
	add_theme_support( 'disable-custom-colors' );
}

add_action( 'after_setup_theme', 'set_colors' );

I verified the color formatter was not enabled to add colors to new parts of the text.
I verified the color formatter still appeared on the parts of the text with a color previously enabled and I verified that if I click the formatter the color is removed.

@jorgefilipecosta jorgefilipecosta added [Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended labels Feb 13, 2020
@jorgefilipecosta jorgefilipecosta changed the title Fix:Text Color formatter appears when color choosing is not possible Fix: Text Color formatter appears when color choosing is not possible Feb 14, 2020
@jorgefilipecosta jorgefilipecosta force-pushed the fix/RichText-Text-Color-formatting-option-still-available-with-the-empty-color-palette branch from 2d8040e to 2fe7f07 Compare February 17, 2020 18:05
@jorgefilipecosta jorgefilipecosta changed the title Fix: Text Color formatter appears when color choosing is not possible Fix: Color formatter appears when color choosing is not possible Feb 17, 2020
@jorgefilipecosta jorgefilipecosta merged commit 51fd214 into master Feb 17, 2020
@jorgefilipecosta jorgefilipecosta deleted the fix/RichText-Text-Color-formatting-option-still-available-with-the-empty-color-palette branch February 17, 2020 18:48
@github-actions github-actions bot added this to the Gutenberg 7.6 milestone Feb 17, 2020
@jorgefilipecosta jorgefilipecosta added 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 Feb 17, 2020
@jorgefilipecosta jorgefilipecosta 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 Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Format library /packages/format-library [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RichText Text Color formatting option still available with empty color palette
1 participant