Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to remove links from bp_activity_content_body()


  • Marcos Nobre
    Participant

    @onyx808

    Hey guys,

    I been at this for a week now… one of my sites is getting spam links on the activity page, I added captcha to the sign up, require email confirmation to sign up, etc. and still getting people posting spam links.

    I would like do disable the links from the activity stream complete and return text only.

    I see that the content is outputted by bp_activity_content_body(), but I cant figure it out how to strip the “a” tags =(

    Thank you!

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    There are before and after save filter hooks.

    After it’s saved, use the filter in bp_activity_content_body
    apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );

    Before it is saved, use this hook in bp-activity\classes\class-bp-activity-activity.php
    apply_filters_ref_array( 'bp_activity_content_before_save', array( $this->content, &$this ) );

    Both filter functions will require you to do some php string parsing – easy to do.
    Lots of info out there, like: http://www.stumiller.me/code-snippet-strip-links-from-string-in-php/

Viewing 1 replies (of 1 total)
  • The topic ‘How to remove links from bp_activity_content_body()’ is closed to new replies.
Skip to toolbar