This is what I’ve got so far, but it’s not working…
`function nla_bp_has_activities($val){
global $activities_template;$i=0;$a=array();
//var_dump($activities_template);exit();
foreach($activities_template->activities as $item){
if($item->type == “joined_group”)
$a[]=$i;
$i++;
}
foreach($a as $item)unset($activities_template->activities[$item]);
array_values($activities_template->activities);
$activities_template->activity_count=count($activities_template->activities);
$activities_template->total_activity_count=count($activities_template->activities);
//var_dump($activities_template);exit();
return $val;
}
add_action( ‘bp_has_activities’,’nla_bp_has_activities’ );`
There’s a plugin for this:
https://wordpress.org/extend/plugins/buddypress-block-activity-stream-types/
It’s an older plugin and the developer is now busy with other projects, so you’ll need to update the plugin manually so the admin menu will show up in WP.
Read this tutorial:
http://code.ipstenu.org/2011/wordpress-3-1-network-menu/
(Edit) Just read the full post, you want to hide it from group feeds only? Or throughout the site? If throughout the site, the plugin will do the job. If only on group feeds, you can take the basic premise from the plugin, then you’ll need to do a conditional to check if you’re in a BP feed.
That plugin you mentioned appears to prevent saving of certain activity types. Since I still want “user joined the group” messages to appear on non-feed pages, that plugin doesn’t really help.
In the end I came up with this code, which appears to work well so far:
`function nla_bp_has_activities( $val )
{
if( ! is_feed() )
return $val;
global $activities_template;
$i=0;
foreach( $activities_template->activities as $item )
{
if( $item->type == “joined_group” )
$joined[] = $i;
$i++;
}
foreach( $joined as $item )
unset( $activities_template->activities[$item] );
foreach( $activities_template->activities as $item )
$activities[] = $item;
$activities_template->activities = $activities;
$activities_template->activity_count = count( $activities_template->activities );
$activities_template->total_activity_count = count( $activities_template->activities );
$GLOBALS = $activities_template;
return $val;
}
add_action( ‘bp_has_activities’, ‘nla_bp_has_activities’ );`