Notifications
Clear all

wpForo 1.x.x [Closed] Custom Color Palette (when editing)

3 Posts
2 Users
1 Likes
379 Views
Alsansan
Posts: 9
Topic starter
(@alsansan)
Active Member
Joined: 2 years ago

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
Alvina
Posts: 1872
Moderator
(@alvina)
Member
Joined: 3 years ago

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.

1 Reply
Alsansan
(@alsansan)
Joined: 2 years ago

Active Member
Posts: 9

@alvina ok, I thought maybe wpforo use different editors for creating and editing or something. But if not the case, i'll see how to fix.

Thank you anyway, Alvina ๐Ÿ™‚

Share: