- This topic has 0 replies, 1 voice, and was last updated 11 months ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- You must be logged in to reply to this topic.
Welcome › mkmcst community Forum › Web programming › WordPress › buddypress › exclude the users from the members directory
add_action(‘bp_ajax_querystring’,’bpdev_exclude_users’,20,2);
function bpdev_exclude_users($qs=false,$object=false){
//list of users to exclude
$excluded_user=’1,2,3′;//comma separated ids of users whom you want to exclude
if($object!=’members’)//hide for members only
return $qs;
$args=wp_parse_args($qs);
//check if we are listing friends?, do not exclude in this case
if(!empty($args[‘user_id’]))
return $qs;
if(!empty($args[‘exclude’]))
$args[‘exclude’]=$args[‘exclude’].’,’.$excluded_user;
else
$args[‘exclude’]=$excluded_user;
$qs=build_query($args);
return $qs;
}