Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbPress & tinyMCE


  • mateomrqz
    Participant

    @mateomrqz

    Hello!

    I’m having some issues styling the buttons in the bbPress Topics/Forum section. My website contains a large amount of TinyMCE editors — some need specific styles and buttons. Assigning this was very easy to my custom editors, but I’m facing an issue when trying to customize the bbpress editor. None of the code I found in the forums seems to do anything to the buttons.

    Here is a snipped of how I’m modifying my other editors. Since these are custom, Is easy to modify by just adding the parameters.

    wp_editor(
        $options['callout_body'],
        'callout_body’, //ID OF EDITOR
        array(
            'textarea_name' => 'page_options_employer_guide_thrive_overview[callout_body]',
            'media_buttons' => false,
            'textarea_rows' => 8,
            'tabindex' => 4,
            'quicktags' => false,
            'tinymce' => array(
            'toolbar1'=> 'bold,italic',
            'toolbar2'=> '',
            'toolbar3'=> '',
            ),
        )
    );
    

    The buttons that I need displayed in the bbpress editor are different from any other custom post type or options page editor.

    I’ve tried every snippet I could find in the forums with no luck, no change. I tried to hook to the examples and add filters, with no luck as well.

    I hope I’m clear enough to what I’m trying to achieve.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

  • Robin W
    Moderator

    @robin-w

    not totally sure what you are after – this any good

    https://gist.github.com/ntwb/7797990

    ?


    mateomrqz
    Participant

    @mateomrqz

    Hi!

    Thank you for the reply. I just want to edit the wp_editor that displays when I click
    “Topics” > “New Topic”.

    I want to remove a couple of buttons of that editor, but I don’t want the change to be global, as I have a lot of other editors with specific parameters. This function works:

    function my_format_TinyMCE( $in ) {
        //styles for the editor to provide better visual representation.
        $in['content_css'] = get_template_directory_uri() . "/build/styles/tiny-mce-editor.css";
        $in['block_formats'] = "Paragraph=p; Heading 1=h1; Heading 2=h2";
        $in['toolbar1'] = 'formatselect,bold,italic,underline,superscript,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker';
        $in['toolbar2'] = '';
        $in['toolbar3'] = '';
        $in['toolbar4'] = '';
        return $in;
    }
    add_filter( 'tiny_mce_before_init', 'my_format_TinyMCE' );

    BUT! It will affect and overwrite parameters to my other editors.
    The Hooks/Filters in the documentation of bbpress work, but they seem to only affect when creating a topic/forum not from the wp-admin but from the actual bbpress page.

    Any ideas? Thank you!

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