Last active
August 29, 2015 14:05
-
-
Save BoweFrankema/ed8ea0435223d7b361d5 to your computer and use it in GitHub Desktop.
BuddyPress Block Activity Types Plugin replacement
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
<?php | |
//Block certain activity types from being added | |
function bp_activity_dont_save( $activity_object ) { | |
$exclude = array( | |
'updated_profile', | |
'new_member', | |
'new_avatar', | |
'friendship_created', | |
'joined_group' | |
); | |
// if the activity type is empty, it stops BuddyPress BP_Activity_Activity::save() function | |
if( in_array( $activity_object->type, $exclude ) ) | |
$activity_object->type = false; | |
} | |
add_action('bp_activity_before_save', 'bp_activity_dont_save', 10, 1 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is awesome. I've stupidly been filtering them out of the activity feed which is a pain. Thanks!