Info
- 7 posts
- 3 voices
- Started 4 years ago by _ck_
- Latest reply from benbeltran
- This topic is not resolved
bbpress doesn't auto-close tags?
-
- Posted 4 years ago #
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?
-
- Posted 4 years ago #
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
-
- Posted 4 years ago #
-
- Posted 4 years ago #
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
-
- Posted 4 years ago #
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.
-
- Posted 4 years ago #
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');
-
- Posted 4 years ago #
works wonderfully ... now to see if I can make it work for the bb-signatures plugin :).
-
You must log in to post.