AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] Custom Color Palette (when editing)

3 Posts
2 Users
1 Reactions
1,374 Views
Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@alsansan)
Active Member
Joined: 5 years ago
[#15193]

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: 1857
Moderator
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@alvina)
Member
Joined: 7 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)
Joined: 5 years ago

Active Member
Posts: 9
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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: