apply_filters( 'bbp_get_the_content', $output, $args, $post_content );
in
bbpress 2.6.6\includes\common\template.php
line 1940
should do it
Hey Robin,
I appreciate the reply! But the apply_filters command allows me to run all the filters and then returns the output. I’m wondering if there is a filter that is similar to bbp_new_reply_pre_content, but for all content that is displayed, edited, or saved.
Or I am I misinformed? I will look into trying out apply_filters in my functions.php
sorry, from your original post, I had presumed you were familiar with filters.
so you would use an add_filter to change the output – do you need help with that?
I was familiar, just a brain freeze early on Monday 🙂
But please let me know what arguments I should pass that would get the outcome I am hoping for. I was wanting for “\r \n” in TinyMCE to be replaced with <br /> tags. The WordPress database was not saving those escaped characters or at the very least wasn’t displaying them back. Eerything was being shown in one line. Teeny and TinyMCE is enabled.
For the time being, I did find an alternative solution. Replaced the “\r \n” with <br /> for the posts and disabled the bbp_code_trick_reverse filter that was removing them later.
function bbp_convert_reply_breaks_to_tags($output, $args, $post_content){
$text = str_replace(array("\r\n", "\n", "\r"), "<br />", $post_content);
return $text;
}
function bbp_convert_topic_and_forum_breaks_to_tags($post_content){
$text = str_replace(array("\r\n", "\n", "\r"), "<br />", $post_content);
return $text;
}
add_filter('bbp_new_reply_pre_content', array($this, 'bbp_convert_reply_breaks_to_tags'), 10, 3);
add_filter('bbp_new_topic_pre_content', array($this, 'bbp_convert_topic_breaks_to_tags'), 10, 1);
add_filter('bbp_new_forum_pre_content', array($this, 'bbp_convert_topic_and_forum_breaks_to_tags'), 10, 1);
remove_filter('bbp_get_form_reply_content', 'bbp_code_trick_reverse');
remove_filter('bbp_get_form_forum_content', 'bbp_code_trick_reverse');
remove_filter('bbp_get_form_topic_content', 'bbp_code_trick_reverse');
I would suggest $output, but you may need to play with the variables to see what each does