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
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
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.
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 .