I also tried the plugin
https://wordpress.org/plugins/buddypress-block-activity-stream-types/
but it seems it’s an orphaned one not updated for a couple of years
What I really hope to do is to prevent bbPress new topics and replies from appearing in the Activity stream – it’s really quite redundant I feel
Help anyone?
@palmdoc, @benny390
You can try @imath solution and edit it accordingly to include bbpress.
/* beginning of the code to paste in the functions.php of your active theme */
‘function imath_activivity_dont_save( $activity_object ) {
// friendship_created is fired when a member accepts a friend request
// joined_group is fired when a member joins a group.
$exclude = array( ‘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’, ‘imath_activivity_dont_save’, 10, 1 );’
BuddyPress Block Activity Stream Types is working absolutely fine even with BP 2.0
@sharmavishal: It doesn’t seem to work for me
I put Blocked Activity Types:
new_forum_topic, new_forum_post
and the bbPress topics and replies still go thru
@naijaping and anyone, what should the code be? Like this? :
// Filter bbPress from updating activity stream
function imath_activity_dont_save( $activity_object ) {
$exclude = array( 'new_forum_topic', 'new_forum_post');
// 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', 'imath_activity_dont_save', 10, 1 );
I just tried that and it doesn’t prevent bbPress from updating the Activity stream đ
OK got the types wrong and got to=he info from the table in phpmyadmin
Anyway this code works in ones custom function.php
// Filter bbPress from updating activity stream
function imath_activity_dont_save( $activity_object ) {
$exclude = array( 'bbp_topic_create', 'bbp_reply_create');
// 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', 'imath_activity_dont_save', 10, 1 );
@benny390, @palmdoc, glad its all sorted
Naijaping
@naijaping
What would I use to block these? I see âfriendship_createdâ, âjoined_groupâ for example…
âusername joined the group YOGAâ would be “joined_group”
âusername and anotheruser are now friendsâ is this one âfriendship_createdâ?
âusername changed their profile pictureâ ???
âusername became a registered memberâ ???
Thanks!