-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
TinyMCE textcolor_map #11147
Comments
On beta version 4.9.9-alpha-43656 on Mac, Chrome latest (70.0.3538.77), with Gutenberg v4.1.1, I can reproduce. Steps to reproduce Add filter:
Screenshot Notes You can see that the colors aren't respected but the number of rows config is. |
@danielbachhuber yep. #10968 fixes the default colors list, however it doesn't show the custom colors properly. |
I am not sure what change I need to make to test it. It is still broken on my implementation.
On Tuesday, October 30, 2018, 11:10:06 AM CDT, Nate Stewart <[email protected]> wrote:
@danielbachhuber yep. #10968 fixes the default colors list, however it doesn't show the custom colors properly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@becomevocal sorry but I'm not sure what is the intent of the example code. Having |
If this has been corrected, could you please provide some sample working code so I can ensure my plugin is configured correctly? Or if I need to install a newer version of the editor could you please point me in the right direction?
My current implementation still shows white boxes.
add_filter('tiny_mce_before_init', 'change_tinymce_color_options');
function change_tinymce_color_options($options) {
$custom_colours = '
"000000", "Black",
"993300", "Burnt orange",
"333300", "Dark olive",
"003300", "Dark green",
"003366", "Dark azure",
"000080", "Navy Blue",
"333399", "Indigo",
"333333", "Very dark gray",
"800000", "Maroon",
$options['textcolor_map'] = '['.$custom_colours.']';
return $options;
}
On Tuesday, October 30, 2018, 3:19:01 PM CDT, Andrew Ozz <[email protected]> wrote:
@becomevocal sorry but I'm not sure what is the intent of the example code. Having $init['textcolor_rows'] = 1; means "hide all colors table rows except the first one", and that is what happens. If you remove that setting, the extra colors show up.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@azaozz you're right :) Seems like this is being fixed in #10968 so this ticket can probably be marked duplicate? @sshelby1 I got this to work by making the changes to my install as listed here: https://github.com/WordPress/gutenberg/pull/10968/files |
closed by #10968 |
Describe the bug
When filtering the TinyMCE textcolor_map option the colors are replaced with blanks.
To Reproduce
Steps to reproduce the behavior:
Filter the editor as so:
add_filter('tiny_mce_before_init', 'change_tinymce_color_options');
function change_tinymce_color_options($options) {
$custom_colours = '
"000000", "Black",
"993300", "Burnt orange",
"333300", "Dark olive",
"003300", "Dark green",
"003366", "Dark azure",
"000080", "Navy Blue",
"333399", "Indigo",
"333333", "Very dark gray",
"800000", "Maroon",
$options['textcolor_map'] = '['.$custom_colours.']';
}
Expected behavior
the custom colors should be visible in the tinymce editor when using a classic editor block
Screenshots
The text was updated successfully, but these errors were encountered: