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

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Problem with TinyMCE editor customization

3 Posts
2 Users
0 Reactions
1,582 Views
Posts: 5
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
(@jaypad)
Active Member
Joined: 6 years ago
[#14730]

Hello,

I wish to let my forum users use more functionnalities than the standard toolbar is offering. In order to do that, I add in my functions.php the following code

add_filter( 'wp_editor_settings', function( $settings ){
if ( empty( $settings['tinymce'] ) || ! is_array( $settings['tinymce'] ) )
$settings['tinymce'] = [];

$settings['tinymce']['toolbar1'] = 'cut,copy,paste,pastetext,undo,redo,hr,link,unlink,blockquote,pre,wpf_spoil,source_code,fullscreen,|,fontsizeselect,bold,italic,underline,strikethrough,subscript,superscript,forecolor,backcolor,removeformat,alignleft,aligncenter,alignright,bullist,numlist,outdent,indent,wp_adv,emoticons';
return $settings;
});

And... it works, unless for editing posts, where the new toolbar settings don't work, I just have the standard toolbar.

So, I would like to know if there is a way to make the cutomization work in all the situations where the editor is involved.

 

 toolbars

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 @jaypad,

Instead of this hook:

wp_editor_settings

You should use the following one:

wpforo_editor_settings

Posts: 5
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
(@jaypad)
Active Member
Joined: 6 years ago

Thanks a lot, it works now.


Share: