Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove HTML tags excluding image tag from activity stream

Viewing 3 replies - 1 through 3 (of 3 total)

  • danbp
    Moderator

    @danbp

    Hi @chatty24,

    Instead of disallowing, allow those you need. 😉

    //  allow tags on updates form
    function bpfr_whitelist_tags_in_activity( $allowedtags ) {
        $allowedtags['img']['target'] = array();    
        return $allowedtags;
    }
    add_filter( 'bp_activity_allowed_tags', 'bpfr_whitelist_tags_in_activity' );

    Reference: bp-activity-filters.php:184


    chatty24
    Participant

    @chatty24

    @danbp

    Thanks for the reply but when I am adding this code to functions.php file the image upload plugin I am using is not uploading the pictures. 🙁


    Henry Wright
    Moderator

    @henrywright

    Hi @chatty24

    You’ll need to find out which tags and attributes are required by the image upload plugin and add them to the whitelist (i.e. the $allowedtags array in @danbp’s function above). Right now, it seems only the img tag and target attribute are allowed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove HTML tags excluding image tag from activity stream’ is closed to new replies.
Skip to toolbar