Skip to:
Content
Pages
Categories
Search
Top
Bottom

BBCode Buttons?


  • Moobs
    Participant

    @nickyb713

    I’m looking for a way to get bbcode buttons for users. I have the gd bbpress toolbox, but I’d like to have buttons for those codes on the toolbar. Any suggestions?

Viewing 1 replies (of 1 total)

  • Robkk
    Moderator

    @robkk

    if you have the pro version they give you an editor for the bbcode/shortcode buttons.

    If you are messing with the bbPress default quicktags you can change the buttons output display to bbcode/shortcodes instead of html.

    If you look at this you can see that it says you can copy the Javsacript from bbPress to your custom child theme.

    https://codex.bbpress.org/theme-compatibility/

    So you can copy the editor.js file from bbPress and created custom buttons for your bbPress installation from there. You can see an example to change the output of the code button to just use quote marks.

    /* Use backticks instead of <code> for the Code button in the editor */
    	if ( typeof( edButtons ) !== 'undefined' ) {
    		edButtons[110] = new QTags.TagButton( 'code', 'code', '<code>', '</code>', 'c' );
    		QTags._buttonsInit();
    	}

    This will I think use the bold, italics , and lists format that they use in the plugin.

    /* Use some bbcode outputs for the quicktags editor in bbPress */
    	if ( typeof( edButtons ) !== 'undefined' ) {
    		edButtons[10] = new QTags.TagButton( 'strong', 'b', '[b]', '[/b]', 'b' );
    		edButtons[20] = new QTags.TagButton( 'em', 'i', '[i]', '[/i]', 'i' );
    		edButtons[80] = new QTags.TagButton( 'ul', 'ul', '[ul]', '[/ul]', 'u' );
    		edButtons[90] = new QTags.TagButton( 'ol', 'ol', '[ol]', '[/ol]', 'o' );
    		edButtons[100] = new QTags.TagButton( 'li', 'li', '[li]', '[/li]', 'l' );
    		QTags._buttonsInit();
    	}
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar