Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to remove HTML tags from activity stream


  • chatty24
    Participant

    @chatty24

    How do I block the HTML tags from being executing in the activity steam. I don’t want my users to add HTML code to their activities.

    Thanks

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

  • Henry Wright
    Moderator

    @henrywright

    Hi @chatty24

    Try:

    function chatty24_no_html_activity( $content ) {
        // Remove all HTML tags from the content and return the result.
        return wp_filter_nohtml_kses( $content );
    }
    add_filter( 'bp_activity_content_before_save', 'chatty24_no_html_activity' );

    Please note I haven’t tested.


    chatty24
    Participant

    @chatty24

    @henrywright

    That works exactly the way I wanted. Thank a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to remove HTML tags from activity stream’ is closed to new replies.
Skip to toolbar