Skip to:
Content
Pages
Categories
Search
Top
Bottom

Adding custom buttons to the editor


  • michaelrichardmurphy
    Participant

    @michaelrichardmurphy

    I’d like to add some custom buttons/functionality to the visual editor in the forums on my site. I have some working code that adds the buttons and functionality to TinyMCE in the WordPress admin for pages and posts but I haven’t been able to get it working in the editor for the forums. Here’s some of that code (exluding the actual JS) that adds two buttons (labeled braille and simbraille) to the visual editor in admin.

    `//custom braille font buttons for tinyMCE
    function braille_add_buttons( $plugin_array ) {
    $plugin_array[‘braille’] = plugins_url( ‘/js/nba-editor.js’, __FILE__ );
    return $plugin_array;
    }
    function braille_register_buttons( $buttons ) {
    array_push( $buttons, ‘braille2000’, ‘simbraille’ );
    return $buttons;
    }
    function braille_font_buttons() {
    add_filter( “mce_external_plugins”, “braille_add_buttons” );
    add_filter( ‘mce_buttons’, ‘braille_register_buttons’ );
    }
    add_action( ‘init’, ‘braille_font_buttons’ ); `

    I found another post in the bbPress forum from somebody else trying to do the same thing (https://bbpress.org/forums/topic/hook-into-bbpress-teeny-mce/) and someone suggested applying a filter to bbp_get_teeny_mce_buttons but that poster couldn’t get it working and I can’t figure out how to adapt the already working code I have to this either. I think eventually that poster found a work around but I really need to get this working so any help would be greatly appreciated!

    The forum is located at http://natlbraille.wpengine.com/forums/
    I’m using bbPress 2.5.8 on WordPress 4.3. If you need any additional info I’m happy to supply it, just ask. Thanks in advance for any help!

  • You must be logged in to reply to this topic.
Skip to toolbar