Members directory showing all useres on multisite
-
Hi, I’m using Buddypress Version 2.5.3 and WordPress 4.5.2.
I’m running a multisite wordpress installation, Right now I’m trying to exclude the suscribers in the members directory, this is the code i found:
function bpdev_exclude_users($qs=false,$object=false){ //list of users to exclude if($object!='members')//hide for members only return $qs; $excluded_user = implode(',',get_users('role=subscriber&fields=ID')); $excluded_admins = implode(',',get_users('role=administrator&fields=ID')); //$excluded_self=bp_loggedin_user_id(); $args=wp_parse_args($qs); //check if we are searching for friends list etc?, do not exclude in this case if(!empty($args['user_id'])) return $qs; if(!empty($args['exclude'])){ $args['exclude']=$args['exclude'].','.$excluded_user; $args['exclude']=$args['exclude'].','.$excluded_admins; //$args['exclude']=$args['exclude'].','.$excluded_self; } else { $args['exclude']=$excluded_user; if(!empty($args['exclude'])) $args['exclude']= $args['exclude'].','.$excluded_admins; else $args['exclude']=$excluded_admins; //$args['exclude']=$excluded_self; } $qs=build_query($args); return $qs; } add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
but right now, the get_users function won’t show any subscriber because there are not suscribers on this site, but on the other ones. Anyway, the buddypress is showing all users including the ones in the other sites.
any hint?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.