How do you add custom color swatches to all WYSIWYG editors?
function my_mce4_options($init) {
$custom_colours = '
"8D9C35", "vert",
"812437", "bordeau",
"EF9CAC", "Rose",
"E5262A", "rouge",
"382848", "noir-mauve",
"FC6050", "orange"
';
// build colour grid default+custom colors
$init['textcolor_map'] = '['.$custom_colours.']';
// change the number of rows in the grid if the number of colors changes
// 8 swatches per row
$init['textcolor_rows'] = 1;
return $init;
}
add_filter('tiny_mce_before_init', 'my_mce4_options');