|//list of users to exclude|
|if($object!='members')//hide for members only|
|$excluded_user=join(',',bpdev_get_subscriber_user_ids());//comma separated ids of users whom you want to exclude|
|//check if we are searching for friends list etc?, do not exclude in this case|
|$subscribers= get_users( array( 'role' => 'subscriber', 'fields' => 'ID' ) );|
Hi, I'm a newbie and know very little php.
There is a mistake on line 33. It should be
Also if you need to add multiple roles you can do this (You need to have at least WordPress Version 4.4 for this to work!):
You can put sbrajesh code in bp-custom.php in the plugins folder. See here for more insight:
Thank you sbrajesh for sharing this code, and unuigbee for the adjustments for multiple roles. It now works awesome. However, it needed a mod that I literally spent half day trying to figure out (which just proves how green I am sometimes) :) so I post this for the next 'copy and paste' coder who is looking for this fix.
I could not get it to work until I changed
The multiple roles thing was huge for me, so I really appreciate that. I'm really not sure if I should have changed the other part instead (removing the word subscriber), but once I got it to work, I didn't dare touch it again. :) If it's a big deal and I should change it, please let me know.