Skip to:
Content
Pages
Categories
Search
Top
Bottom

using WP_Editor instead of default html edit


  • mth75
    Participant

    @mth75

    Hello all,

    On my website i’m trying to use the wp-editor as editor for my bbpress forum (always latest stable version). I use the same code as I use for my WP comments section (to keep the appearances the same).

    The code I use does show the tinymce, doesn’t “parse” the content though (with an “ERROR: Your reply cannot be empty” as result.

    My guess is that I haven’t found the right parameters (***) in the wp_editor function. Help is much appreciated.

    Regards.

    Marc

     
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    function bbp_enable_visual_editor( $args ) {
    	wp_editor( '****', '****', array(
    		'media_buttons' => true, // show insert/upload button(s) to users with permission
    		'textarea_rows' => '10', // re-size text area
    		'dfw' => false, // replace the default full screen with DFW (WordPress 3.4+)
    		'tinymce' => array(
            	'theme_advanced_buttons1' => 'bold,italic,underline,strikethrough,bullist,numlist,code,blockquote,link,unlink,outdent,indent,|,undo,redo,fullscreen',
    	        'theme_advanced_buttons2' => '', // 2nd row, if needed
            	'theme_advanced_buttons3' => '', // 3rd row, if needed
            	'theme_advanced_buttons4' => '' // 4th row, if needed
      	  	),
    		'quicktags' => array(
     	       'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'
    	    )
    	) );
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)

  • mth75
    Participant

    @mth75

    I solved it like this:

    // add tinymce for BBPress as default editor
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
    	$args['media_buttons'] = true;
    	$args['textarea_rows'] = true;
    	$args['dfw'] = false;
    	$args['tinymce'] = array( 'theme_advanced_buttons1' =>'bold,italic,underline,strikethrough,bullist,numlist,code,blockquote,link,unlink,outdent,indent,|,undo,redo,fullscreen',
    'theme_advanced_buttons2' => '', // 2nd row, if needed
            	'theme_advanced_buttons3' => '', // 3rd row, if needed
            	'theme_advanced_buttons4' => '', ); // 4th row, if needed	
    	$args['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');
        return $args;	
    }

    Nice, thanks for this 🙂


    avgmatt
    Participant

    @avgmatt

    I am having the hardest time getting visual buttons on my forum. I will try this. Where are you adding this code?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar