Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: A new activities stream

@modemlooper

Moderator

You have to create a function similar to what I’m using below. Play with the if statement after the for each loop.

`
function bp_my_activity_filter( $a, $activities ) {
global $bp;

if ( $bp->current_component != $bp->activity->slug )
return $activities;

foreach( $activities->activities as $key => $activity ) {
if ( $activity->type ==’activity_update’ && $activity->item_id == ’34’ || $activity->type ==’new_forum_topic’ && $activity->item_id == ’34’ ) {
unset( $activities->activities[$key] );
$activities->total_activity_count = $activities->total_activity_count – 1;
$activities->activity_count = $activities->activity_count – 1;
}
}

$activities_new = array_values( $activities->activities );
$activities->activities = $activities_new;
return $activities;
}
add_action( ‘bp_has_activities’, ‘bp_my_activity_filter’, 10, 2 );
`

Skip to toolbar