@henrywright-1
Yes by default. Not really sure why but you could write a function to exclude the current logged in user.
Thanks for confirming. I’ll just filter out the logged in user. Probably also do it for the follow pages (I’m using the BP follow plugin too)
@henrywright-1
https://wordpress.org/plugins/bp-ninja/ ?
I haven’t tried it myself.
I’ve seen code snippets around for a stealth mode but don’t have anything to hand…. https://www.google.com/search?q=buddypress+stealth+mode
Thanks @ aces seems like an interesting plugin. I’ll check it out
I ended up using if ( bp_get_member_user_id() == bp_loggedin_user_id() ) continue;
right after bp_the_member()
in members-loop.php. I borrowed the idea from an old post by @r-a-y
The only drawback with this approach is the numbers in the pagination will be off by 1.
So even though the pagination might read “Showing 1 – 5 of 5 members”, you will see just 4 members on the page (the 5th member is the current user who we’ve just excluded).
Solution:
Add the code in the functions’ theme file.
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=bp_loggedin_user_id();//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 searching or we are listing friends?, do not exclude in this case
if(!empty($args['user_id'])||!empty($args['search_terms']))
return $qs;
if(!empty($args['exclude']))
$args['exclude']=$args['exclude'].','.$excluded_user;
else
$args['exclude']=$excluded_user;
$qs=build_query($args);
return $qs;
}