Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

With bp-multi-network it appears members are shared across all networks.

Example - networks based on location.

newyork.mydomain.com, losangeles.mydomain.com, vancouver.mydomain.com

At present a member of any network is listed in any other network's members directory if they are active in the other network.

So each Members Directory lists all members of the entire installation who have accessed that network.

So if a "New York" member becomes active on the "Los Angeles" network they are listed in the Los Angeles Members Directory and vice-versa

Now what if I also wanted a members list of just those members who joined in New York and a members list of just those members who joined in Los Angeles and a members list of just those members who joined in Vancouver etc etc.

A viable solution is perhaps if I had

1) a required registration field (Your Location) drop down with the locations and then

2) a page on each network listing the members who have listed this location in the required field registration form

I understand this involves interacting with WP_Query about which I have not got the faintest clue.

If there is anyone out there who can attempt this or even point me in the right direction I'd be thrilled.

share|improve this question

closed as off-topic by toscho Aug 4 at 21:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

You can filter the members loop in BuddyPress by meta values for the members. So you would need to change the loop in the template file members/members-loop.php to be:

<?php
// Getting current blog_id 
global $wpdb, $current_blog;
$id = $current_blog->blog_id;
// Setting variable for current blog_prefix
$blog_prefix = $wpdb->get_blog_prefix( $id );
// Start the BuddyPress Ajax Members Loop
if ( bp_has_members( bp_ajax_querystring( 'members' ).'&meta_key='.$blog_prefix.'capabilities' ) )  : ?>
share|improve this answer
    
This works nicely, but I wonder if it could be streamlined using get_current_blog_id instead of reaching into the database. I'm playing around with it, but I'm pretty poor at these things. –  user29159 Mar 19 '13 at 13:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.