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?
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.
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()