How to filter members by blog/site in multisite installation
-
Hi…
PROBLEM:
How to filter members directory by site/blog id?, so in a multisite installation with one BP instance were possible to filter only the registered member in the current blog/site directory members.SOLUTION:
In bp-custom.php:
————————————
function include_users() {
$sitio_id = get_current_blog_id();
$included_users = implode(‘,’,get_users(‘blog_id=’.$sitio_id.’&fields=ID’));
return $included_users;
}In members-loop.php (about line #50, find and modify):
————————————
$members_loop_query = apply_filters(‘woffice_members_loop_query’, bp_ajax_querystring( ‘members’ ).’&exclude=’.$exclude_members.’&include=’.include_users() );I take this idea from:
http://twentythreedegrees.co.uk/exclude-include-members-by-user-role-in-a-buddypress-members-loop/BUT….
Still have not found how to filter (or where to do that) for the member widget or even better, sitewide? (whereever a member list, plugin or widget need to list BP members).
¿Someone can give me some help with this??
- You must be logged in to reply to this topic.