Re: Allow image plugin in forums
This is what I use in my forums:
function gs_bp_forums_add_allowed_tags( $allowedtags ) {
if ( bp_is_group_forum_topic() ) {
$allowedtags['img'] = array( 'src' => array() );
$allowedtags['del'] = array();
$allowedtags['p'] = array();
$allowedtags['br'] = array();
$allowedtags['cite'] = array();
$allowedtags['blockquote'] = array();
$allowedtags['h3'] = array();
$allowedtags['strong'] = array();
$allowedtags['em'] = array();
}
return $allowedtags;
}
add_action( 'plugins_loaded', 'gs_configure_forum_filters' );
function gs_configure_forum_filters() {
remove_filter( 'bp_get_the_topic_post_content', 'attribute_escape' );
remove_filter( 'bp_get_the_topic_post_content', 'convert_smilies' );
remove_filter( 'bp_get_the_topic_post_content', 'convert_chars' );
add_filter( 'edit_allowedtags', 'gs_bp_forums_add_allowed_tags' );
}