Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to enable one shortcode from a plugin in bbPress (CodeColorer)


  • Hansaplastique
    Participant

    @hansaplastique

    I’d like to offer visitors the ability to use CodeColorer to syntax highlight their code.

    I know that shortcodes are basically disabled for security reasons – which makes sense.

    But how can I add a “safe” shortcode to bbpress?
    The WP plugin bbPress2 Shortcode Whitelist and bbPress do shortcodes are not working (the latter even being risky at best).

    bbPress: 2.2.3
    WP: 3.5
    Theme: my own development

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

  • Hansaplastique
    Participant

    @hansaplastique

    Never mind; figured it out (by coincidence).

    If anyone is interested, add the following code to your wordpress functions.php;

    function t4a_bbp_shortcodes( $content, $reply_id ) {
    	return codecolorer_highlight( $content );
    }
    add_filter('bbp_get_reply_content', 't4a_bbp_shortcodes', 10, 2);
    add_filter('bbp_get_topic_content', 't4a_bbp_shortcodes', 10, 2);

    Hansaplastique
    Participant

    @hansaplastique

    Oh you of course will need CodeColorer plugin installed …

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

You must be logged in to reply to this topic.