Skip to content

Instantly share code, notes, and snippets.

@BoweFrankema
Last active August 29, 2015 14:05
Show Gist options
  • Save BoweFrankema/ed8ea0435223d7b361d5 to your computer and use it in GitHub Desktop.
Save BoweFrankema/ed8ea0435223d7b361d5 to your computer and use it in GitHub Desktop.
BuddyPress Block Activity Types Plugin replacement
<?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 );
?>
@sharmstr
Copy link

sharmstr commented Sep 4, 2014

This is awesome. I've stupidly been filtering them out of the activity feed which is a pain. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment