hi @pws2015,
try this. Add snippets to bp-custom.php
First snippet is mandatory, second is an option. Note that hidden members activities and profiles stay public. The below code let you only hide users from the members directory.
// hide members on directory
function bpfr_hide_users_on_directory( $qs=false, $object=false ){
// Id's to hide, separated by comma
$excluded_user = '5,38,30';
// hide to members & friends
if($object != 'members' && $object != 'friends')
return $qs;
$args = wp_parse_args($qs);
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;
}
add_action( 'bp_ajax_querystring','bpfr_hide_users_on_directory', 20, 2 );
// once hidden, we recount the members
function bpfr_hide_get_total_filter($count){
return $count-1;
}
add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');
hi,
thanks..
haven’t plugin do this (not chnages source code)? and not display from all pages, map, search form… ??
Sorry, i don’t understand what you write.