Skip to:
Content
Pages
Categories
Search
Top
Bottom

Activity Stream – Remove specific activities

  • Avatar of Bookkus
    Bookkus
    Participant

    @bookkus

    I recently added achievements for buddypress and along with the regular activities they are really spamming up the system. It looks like nothing is happening, except a few unimportant things. I really want to remove:
    new users
    friend creation
    all achievements

    I am still an amateur, but really want to learn to do these things. If someone could guide me through the steps of how to find what to change and how I only choose specific attributes. I always have trouble finding the right functions to use. Any help in this direction would be great.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    You can put this function in your theme functions.php or bp-custom.php

    It will prevent the creation of activity entries for the items in $exclude
    It will only do that going forward – it won’t remove existing entries.

    You need to find out what the activity type(s) is for achievements and add it to the exclude array.

    function dont_save_various_activities( $activity_object ) {
     
        $exclude = array( 'friendship_created', 'new_member' );
    
        if( in_array( $activity_object->type, $exclude ) )
            $activity_object->type = false;
     
    }
    add_action('bp_activity_before_save', 'dont_save_various_activities', 1, 1 );

    You can read more on this great codex page by imath
    http://codex.buddypress.org/plugindev/bp_activity_add-2/

    Avatar of Bookkus
    Bookkus
    Participant

    @bookkus

    Thanks. I’ll give it a try.

    -William

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

You must be logged in to reply to this topic.