Support » Plugin: WP-Syntax » bbPress support?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author shazahm1


    @arnan de Gans

    Sure, I’ll add it to my feature request. I could actually use that myself so it’ll likely come sooner than later.

    Plugin Author shazahm1


    @arnan de Gans

    For regular commentors or forum moderators only? I’m leaning to the moderators only.

    What I need is that it works for everyone, perhaps you can make a checkmark in settings to make it optional to create a sense of security/control.

    THanks for the quick replies!

    When do you think you can make an update?

    Plugin Author shazahm1


    @arnan de Gans

    it’s on my to do list for March.

    Oh right 🙂 thanks!

    I’d love to see if for all forum members 🙂

    I added this code to functions.php/etc to turn backticks (just like used on the .org forums) into <pre lang=”PHP”>

    	Switch <code></code> with <pre lang="PHP"></pre>
    function pmpro_code_wrap($content)
    	$content = preg_replace("/<code>(.*)</code>/s", '<pre lang="PHP">$1</pre>', $content);
    	return $content;
    add_filter("the_content", "pmpro_code_wrap", -1);

    I think it might not handle nested backticks properly, but is a start.

    Yeah, even choked on that.

    replace the code tags in the preg_replace line with backticks. I made a gist:

    strangerstudios thanks for the tip, but your code is not working 🙁 I put it into wp-includes/functions.php, but wp-syntax highlighting still don’t work in bbpress forum posts! Could you help me?

    I also didn’t understand what did you mean with “functions.php/etc”… ?


    I figured it out!

    I inserted this to the end to my template’s functions.php (if functions.php doesn’t exist, create it):

    add_filter('bbp_get_reply_content', array("WP_Syntax", 'beforeFilter' ), 0);
    add_filter('bbp_get_topic_content', array("WP_Syntax", 'beforeFilter' ), 0);
    add_filter('bbp_get_reply_content', array("WP_Syntax", 'afterFilter' ), 99);
    add_filter('bbp_get_topic_content', array("WP_Syntax", 'afterFilter' ), 99);

    Plus, to the beginning of the file I copy’n’pasted the whole CUSTOM_TAGS block from the base functions.php of wordpress. Of course, with the modification at the pre tag:

    'pre' => array(
    			'width' => true,
    			'lang' => true

    If you need other paramters, you should add them.

    Now I have fully functional wp-syntax highlighting in bbpress replies, too!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘bbPress support?’ is closed to new replies.