Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_has_members loop


  • landwire
    Participant

    @landwire

    Hi there,
    is there a way to include an argument $user_role into the bp_has_members loop? Or somehow else achieve that only users of a particular role are shown? Ideally all users are shown in one tab and then have additional tabs for other specified user roles (so administrator and other roles can be excluded). With the following code I managed to show only ‘author’ role, but my ajax filters do not work and I still get the number of all users shown in the tab (but the correct number in ‘Viewing member 1 to 16’).

    Here is the code I’m using:

    
    
    <?php
    $user_role = array (
    'role' => 'author',
    );
    
    $all_authors = get_users ($user_role);
    
    $members_to_be_included = array ();
    foreach ($all_authors as $all_author) {
    $members_to_be_included[] = $all_author->ID;
    }
    ?>
    
    

    Has anyone got some better ideas on this, that might work better and with the ajax?

  • The topic ‘bp_has_members loop’ is closed to new replies.
Skip to toolbar