• Is possible to add enlighter button on TinyMCE for BBPress forums? I just put this code on my theme functions.php in order to activate TinyMCE editor:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor', 'enlighter_frontend_editing' );

    But I can’t find the way to show enlighter options

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Andi Dittrich

    (@andi-dittrich)

    you have to load to plugin (plugin + styles + buttons) manually – see https://github.com/EnlighterJS/Plugin.TinyMCE/blob/master/index.html

    bbpress docs: https://codex.bbpress.org/enable-visual-editor/

    Thread Starter jgriguol

    (@jgriguol)

    Hi Andi,
    Thanks for you reply
    Do you know which files should I edit?
    These ones?:
    bbpress/templates/default/bbpress/form-topic.php and
    bbpress/templates/default/bbpress/form-reply.php

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    you don’t have to change files… the filter hook you’ve posted above needs to be modified…instead of passing tinymce=true (which sets the editor to the defaults) you have to pass an associative array including “external_plugins” directive as mentioned in the WordPress docs

    i didn’t have the time to create an example right now, maybe in the next days – sry

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    update: the bbpress tinymce settings doesn’t seem to behave like the standard WordPress functions..

    to add the Enlighter editing plugins you have to modify the code from above to:

    
    add_filter('bbp_after_get_the_content_parse_args', function($args = array()){
        $args['tinymce'] = true;
        $args['teeny'] = false;
        $args['quicktags'] = false;
        
        return $args;
    });
    

    and enable Enlighter -> Visual Editor -> TinyMCE - Frontend Integration – this will do the magic for your ??

    Thread Starter jgriguol

    (@jgriguol)

    Hi Andi,
    Thank you very much, it works like a charm!
    Just a one more question.. is possible to enable that option for “guest” (non registered) users?

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    normally it is limited to registered users with capablities to edit posts/pages – but you can override the privileges:

    untested:

    
    // allow frontend editing for any kind of user (not just editors/authors)
    add_filter('enlighter_frontend_editing', function($canEdit){
      return true;
    });
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I activate enlighter button on BBpress’ is closed to new replies.