Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hook into bbPress teeny MCE?


  • mst
    Participant

    @mst

    I need to add a button to bbPress instance of the teeny MCE.

    I’ve used the following code to test how my mce plugin work:

    // add new buttons
    add_filter('mce_buttons', 'myplugin_register_buttons');
    
    function myplugin_register_buttons($buttons) {
       array_push($buttons, 'separator', 'myplugin');
       return $buttons;
    }
     
    // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
    add_filter('mce_external_plugins', 'myplugin_register_tinymce_javascript');
    
    function myplugin_register_tinymce_javascript($plugin_array) {
       $plugin_array['myplugin'] = plugins_url('/js/tinymce-plugin.js',__FILE__);
       return $plugin_array;
    }

    This works like it should on the admin side.

    I can’t wrap my head around how to get the same principle to work for bbPress instance of teeny mce. Which filter/action do I need to use and where? I’ve tried using the teeny_mce_buttons filter without any luck.

    WP 4.2.4, bbPress 2.5.8

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

  • Robkk
    Moderator

    @robkk

    I think there is a different filter for bbPress tinymce buttons. Will check it out later.


    Robkk
    Moderator

    @robkk

    Yeah I think this is the filter.

    apply_filters( 'bbp_get_teeny_mce_buttons', $buttons );

    bbp_get_teeny_mce_buttons

    Any javascript you would need for the buttons you may need to copy editor.js in your child theme in a folder called js so that your code is enqueued.

    Theme Compatibility


    mst
    Participant

    @mst

    Thank you for your answer.

    I did play around bbp_get_teeny_mce_buttons but didn’t get it to play nice.

    I ended up using the full MCE and removed all additional editor rows and trimmed the first row.

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