Re: Removing Blog Posts form the SWA Widget
avim – I had to do something similar recently, and I came up with code along these lines. It’s not perfect (and might only work in 1.2) but it should give you an idea of how such a thing might be done by filtering the output of bp_has_activities:
function bp_remove_blogs_activity( $a, $activities ) {
foreach ( $activities->activities as $key => $activity ) {
if ( $activity->component == 'blogs' )
unset( $activities->activities[$key] );
}
/* Renumber the array keys to account for missing items */
$activities_new = array_values( $activities->activities );
$activities->activities = $activities_new;
return $activities;
}
add_action( 'bp_has_activities', 'bp_remove_blogs_activity', 10, 2 );