Created
September 26, 2014 13:42
-
-
Save bappi-d-great/da834c303f29273abdb3 to your computer and use it in GitHub Desktop.
Remove joined group notification from sitewide activity
This file contains hidden or 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
<?php | |
add_action('bp_has_activities','my_denied_activity_new_member', 999, 2 ); | |
function my_denied_activity_new_member( $a, $activities ){ | |
foreach( $activities->activities as $key => $activity ){ | |
if ( $activity->type =='joined_group') { | |
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment