Skip to:
Content
Pages
Categories
Search
Top
Bottom

custom members loop


  • lokers
    Participant

    @lokers

    I’ve got an array of users’ IDs and I would like to pass it somehow to bp build-in function responsible for printing a loop. Another words, I would like to display custom list of users based on my own custom list.

    Is is possible or is there a plugin or something I could use?

Viewing 4 replies - 1 through 4 (of 4 total)

  • lokers
    Participant

    @lokers

    I need to add something…

    I could actually use bp_has_site_members() function.

    But my users must have custom meta value, if I could pass it here that would do the job but I don’t think it’s possible, is it?


    lokers
    Participant

    @lokers

    ok, I can actually get what I want the other way around. I could run a loop thru my IDs but I need to get somehow all the BP user data, inside the loop, for each user… something more than get_userdata() function. Is there a function like that? I didn’t find anything.

    Any ideas/help are welcome.

    If you need to get the userdata for a particular member you can use:

    <?php $ud = get_userdata( bp_get_the_site_member_user_id() ); ?>

    that will only work inside of the site members loop.


    lokers
    Participant

    @lokers

    yes, but get_userdata() doesn’t return values like avatar and additional profile fields from registration. I found some functions in a core but I am not sure I should go that deep to get this info.

    bp_core_get_userurl()

    bp_core_get_avatar()

    bp_core_get_userlink()

    and finaly the best one:

    xprofile_get_field_data()

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘custom members loop’ is closed to new replies.
Skip to toolbar