Support is monitored from Monday to Saturday in office hours from the GMT timezone. Our response time can be up to 2 business days.

Notice: We do not accept any customization. Please Read Envato Support Policy. But we still can help with little snippets if that's possible!

Okay
  Print

Hide / Exclude Your Own Account From Members Directory

Please use this snippet

<?php
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;
}

Please check this article to know how to add the PHP snippet

https://kainelabs.ticksy.com/article/17309/