filter activity general, activity profile and activity group
-
Hi, escuse my bad english, i’m a php programmer and i must filter all the activity.
in functions.php i’ve created:
function bp_activities_include_activity_types( $retval ) {
// in this function i control if the request is activity general, profile or gruoup
if(bp_is_user_activity()){
$retval[‘scope’] = array(
‘just-me’,
‘friends’,
//’favorites’,
//’following’,
//’mentions’
);$retval[‘object’] = array(
‘groups’,
‘friends’,
‘profile’,
‘status’,
‘blogs’
);$retval[‘action’] = array(
‘activity_coupon’, //my personal activity
‘activity_comment’,
‘activity_liked’,
‘activity_update’,
##’blogpost_liked’,
##’bp_album_picture’,
‘created_group’,
‘friendship_created’,
‘joined_group’,
‘mpp_media_upload’,
## ‘new_avatar’,
## ‘updated_profile’
);}else if(bp_is_group_activity()){ ## or group
## select specified scope object and action
$retval[‘scope’] = array(‘……’);
$retval[‘object’] = array(‘……’);
$retval[‘action’] = array(‘……’);}else{ ## or activity general
## select specified scope object and action
$retval[‘scope’] = array(‘……’);
$retval[‘object’] = array(‘……’);
$retval[‘action’] = array(‘……’);};
}
add_filter( ‘bp_before_has_activities_parse_args’, ‘bp_activities_include_activity_types’ );
I ask if this method is correct, and if is correct in specified menu drop down i can remove the single item
- You must be logged in to reply to this topic.