Created
June 6, 2014 04:19
-
-
Save modemlooper/e0a5a6f52eae757d425e to your computer and use it in GitHub Desktop.
remove group activity from main and profile activity stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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