Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save BoweFrankema/ed8ea0435223d7b361d5 to your computer and use it in GitHub Desktop.
BuddyPress Block Activity Types Plugin replacement
//Block certain activity types from being added
function bp_activity_dont_save( $activity_object ) {
$exclude = array(
// 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 );
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