Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Allow image plugin in forums

@hatiro

Participant

@Gp01

Only really changed the IMG output above to mimic the [a] tag and put the plugin description at the top, dropped it into plugins and activated it.

Problem I’ve got is how to strip out the html in the activity stream, or to turn it into a clickable link with the activity stream…

None of this helps the forum topic here though….sorry…

<?php

/*

Plugin Name: TAG-override

Plugin URI:

Description: Forum tag override function

Version: 0.1

Author:

Author URI:

*.

function gs_bp_forums_add_allowed_tags( $allowedtags ) {

if ( bp_is_group_forum_topic() ) {

$allowedtags[‘a’] = array( ‘href’ => 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’ );

}

?>

Skip to toolbar