Nov 18, 2020 4:18 pm
Hello. I added a tinymce custom color palette with a code snippet. It works fine when creating new topic, but when i edit a topic it displays the old palette. How could I keep the custom palette?
Â
NEW TOPIC
EDIT TOPIC
Â
THE CODE
function my_mce4_options($init) {
$custom_colours = '
"1abc9c", "TURQUOISE",
"16a085", "GREEN SEA",
"2ecc71", "EMERALD",
"27ae60", "NEPHRITIS",
"3498db", "PETER RIVER",
"2980b9", "BELIZE HOLE",
"9b59b6", "AMETHYST",
"8e44ad", "WISTERIA",
"34495e", "WET ASPHALT",
"2c3e50", "MIDNIGHT BLUE",
"f1c40f", "SUN FLOWER",
"f39c12", "ORANGE",
"e67e22", "CARROT",
"d35400", "PUMPKIN",
"e74c3c", "ALIZARIN",
"c0392b", "POMEGRANATE",
"ecf0f1", "CLOUDS",
"bdc3c7", "SILVER",
"95a5a6", "CONCRETE",
"7f8c8d", "ASBESTOS"
';
// 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'] = 4;
$init['textcolor_cols'] = 8;
return $init;
}
add_filter('tiny_mce_before_init', 'my_mce4_options');
Thanks
2 Replies
Nov 19, 2020 11:04 am
Hi @mocs,
This does not have any relation to the wpForo. So it will be better if you contact the TinyMCE plugin's support and ask them this question.