Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Created June 6, 2014 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modemlooper/e0a5a6f52eae757d425e to your computer and use it in GitHub Desktop.
Save modemlooper/e0a5a6f52eae757d425e to your computer and use it in GitHub Desktop.
remove group activity from main and profile activity stream
function bp_filter_groups_from_activity( $a, $activities ) {
if ( bp_is_current_component( 'activity' ) ) {
foreach ( $activities->activities as $key => $activity ) {
if ( $activity->component =='groups') {
unset( $activities->activities[$key] );
$activities->activity_count = $activities->activity_count-1;
$activities->total_activity_count = $activities->total_activity_count-1;
$activities->pag_num = $activities->pag_num -1;
}
}
$activities_new = array_values( $activities->activities );
$activities->activities = $activities_new;
}
return $activities;
}
add_action('bp_has_activities','bp_filter_groups_from_activity', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment