Notifications
Clear all

wpForo 1.x.x [Solved] Problem with TinyMCE editor customization

3 Posts
2 Users
0 Reactions
785 Views
Posts: 5
Topic starter
(@jaypad)
Active Member
Joined: 4 years ago

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.

 

2 Replies
Alvina
Posts: 1863
Moderator
(@alvina)
Member
Joined: 5 years ago

Hi @jaypad,

Instead of this hook:

wp_editor_settings

You should use the following one:

wpforo_editor_settings
Posts: 5
Topic starter
(@jaypad)
Active Member
Joined: 4 years ago

Thanks a lot, it works now.