Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbpress doesn’t auto-close tags?


  • _ck_
    Participant

    @_ck_

    I’ve got sloppy members not closing their tags and the markup runs through the rest of the page. Doesn’t WP already do auto close on tags? Did bbpress not pick up that part of the code?

Viewing 6 replies - 1 through 6 (of 6 total)
  • WP doesn’t auto close tabs by default either (unless the new editor does it). Does anyone know if the QuickTags plugin for bbPress auto closes tabs?

    Trent


    _ck_
    Participant

    @_ck_

    Actually I may be wrong about this.

    I dug through the default filters and I see this:

    add_filter(‘pre_post’, ‘balanceTags’);

    Does balancetags == auto-close tags?

    Looking at the function it would seem to be so.

    Perhaps I have a plugin conflict or does this behaviour exist on even on a default install?

    added: I just tested here and yup, it doesn’t auto-close


    _ck_
    Participant

    @_ck_

    AHA!

    I found a bug. Finally I can contribute.

    WordPress does indeed auto-close tags and has a fantastic routine, the balancetags I mentioned above.

    HOWEVER

    it was copied raw into BBpress and it won’t work by default because it’s looking for an option that will never be set because BBpress doesn’t have it

    function balanceTags($text, $is_comment = 0, $force = false) {

    if ( !$force && get_option(‘use_balanceTags’) == 0 )

    return $text;

    See what I mean? There’s no manually way to set use_balanceTags in BBpress.

    So how do we force the filter on? I know it has to be balanceTags ($text,1,1) to work.


    _ck_
    Participant

    @_ck_

    Yay! I figured out how to hack it to make it happen.

    To leave the core files alone, I did it through a plugin.

    The balancetags in bbpress takes less parameters than from WP.

    function force_balance_tags($text) { return balanceTags($text, true);}

    add_filter('pre_post', 'force_balance_tags');

    Tested working.

    Another nice addition in there would be to add nofollow to any post links.

    add_filter('pre_post', 'bb_rel_nofollow');

    works wonderfully … now to see if I can make it work for the bb-signatures plugin :).

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