Hi @mei-ling,
it’s not an issue but how it works ! 😉
You can filter the activity stream and remove the activities you don’t want to be showed.
Add this snippet to bp-custom.php or your child-theme functions.php
function bpex_bp_activity_types( $retval ) {
if ( bp_is_active( 'activity' ) ) {
// list of all BP activity types - remove or comment those you won't show.
$retval['action'] = '
activity_comment,
activity_update,
// bbp_topic_create,
// bbp_reply_create,
friendship_created,
created_group,
joined_group,
last_activity,
new_avatar,
new_blog_post,
new_blog_comment,
new_member,
updated_profile
';
return $retval;
}
}
add_filter( 'bp_after_has_activities_parse_args', 'bpex_bp_activity_types' );
You might also remove bbpress activities from the activity filter. You can use this (goes to same file as previous)
function bpex_remove_bbp_activities_dropdown_labels() {
if ( bp_is_active( 'activity' ) ) {
// Remove forum filters in site wide activity streams
remove_action( 'bp_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 );
// Remove forum filters in single member activity streams
remove_action( 'bp_member_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 );
// Remove forum filters in single group activity streams
remove_action( 'bp_group_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 );
}
}
add_action( 'bp_init', 'bpex_remove_bbp_activities_dropdown_labels', 9 );
Codex references:
Using bp_parse_args() to filter BuddyPress template loops
bp-custom.php
I thank you a lot 🙂 That’s great
MeiLing
Hello @danbp
PHP Warning: Illegal offset type in /home…./wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php on line 734
I found where the error came from:
add_filter( 'bp_after_has_activities_parse_args', 'activites_affiche_infos' );
function activites_affiche_infos( $retval ) {
// if ( bp_is_active( 'activity' ) ) {
$retval['action'] = array(
'activity_comment',
'activity_update',
//'created_group',
//'friendship_created',
'joined_group',
'last_activity',
//'new_avatar',
'new_blog_comment',
'new_blog_post',
//'new_member',
'updated_profile'
);
return $retval;
// }
}
I feel that this function does not work anymore with the latest version of buddypress. If I disable it, => all works
I activate it by trying several solutions and nothing else works !!
I tried your code without success either
@ +
An “old” member of your BP site
good concept thanks for sharing .