Skip to:
Content
Pages
Categories
Search
Top
Bottom

TinyMCE Advance + BBPress + Custom Button/Plugin


  • cjchamberland
    Participant

    @cjchamberland

    I’m working on a site that HAS to have a “custom” button on TinyMCE to insert a custom string for users through the visual editor on BBPress. It works fine through the wp-admin, but it has to work on the actual forum pages. I located where the failure happens – does anyone know how or what I need to replace this with in order for it to work with BBpress? Or any other hacks I can try?? (It’s basically selecting all the text, then I do a search for a specific item and add their custom string to that item):

    var content = tinyMCE.get(‘content’).getContent();

    Looking at the code, I though maybe it should be:

    var content = tinyMCE.get(‘bb_topic_content’).getContent();

    but that didn’t work either….

Viewing 1 replies (of 1 total)

  • Stagger Lee
    Participant

    @stagger-lee

    Try to play with this in functions.php:
    For some buttons you will need to borrow them from TinyMCE advanced plugin and put in core folder, they dont come in the core. (emoticons, and some else, called “plugins”)

    function bbp_enable_visual_editor( $buttons = array() ) {
    	
    	$buttons['tinymce'] = array( 
    	'toolbar1' =>'bold, italic, underline, strikethrough, blockquote, alignleft, aligncenter, alignright, alignjustify, justifyfull, bullist, numlist, outdent, indent, cut, copy, paste, undo, redo, link, unlink, table, fullscreen, image, media, cleanup, help, code, hr, removeformat, sub, sup, forecolor, forecolorpicker, backcolor, backcolorpicker, charmap, visualaid, anchor, newdocument, pastetext, separator, wp_adv,wptadv,media,image',
        'toolbar2' => 'pastetext, pasteword, selectall, formatselect, fontselect, fontsizeselect, styleselect, strikethrough, outdent, indent, pastetext, removeformat, charmap, wp_more, emoticons, forecolor, wp_help,media,image', // 2nd row, if needed
        'toolbar3' => 'pastetext,pasteword,selectall,paste_as_text,preprocess,paste,media,image', // 3rd row, if needed
        'toolbar4' => 'media,image', // 4th row, if needed 
    	'plugins'  => 'anchor, code, insertdatetime, nonbreaking, print, searchreplace, table, visualblocks, visualchars, emoticons, advlist,wordpress,wplink, paste,fullscreen',
    		   ); // 4th row, if needed 
        $buttons['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');
        return $buttons;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    add_filter('mce_buttons', 'bbp_enable_visual_editor');
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.