Archived topic
change the colors of TyniMCE
5 replies · Started by Luis on August 20, 2017
Good afternoon,
How can I change the colors of TyniMCE? What Hooks should I use?
I want to use the function "my_mce_settings" and then "add_filter ('tiny_mce_before_init', 'my_mce_settings'); But I do not know what hooks I have to use of the many there are!
Thank you very much!
Hi there,
I think wp_head hook should work: https://docs.generatepress.com/article/wp-head/
Hello,
My code is:
function my_mce_settings( $settings ) {
//limita los colores de texto en TinyMCE para sólo tener algunos colores predefinidos
$custom_colors = '"43a9cf", "Azul", "dfa10d", "Naranja", "be7bd2", "Violeta"';
$settings['textcolor_map'] = '['.$custom_colors.']';
return $settings;
}
add_filter('tiny_mce_before_init', 'my_mce_settings');
And it does not work in wp_head
Thank you very much
Ahh try one of these methods instead: https://docs.generatepress.com/article/adding-php/
Okay. I used Code Snippets before using GP, but I thought GP Hooks did the same thing.
okay. Understood, and will continue using Code Snippets.
Thank you very much for clarifying the subject.
No problem!