Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to list user from a specific profile data ???

@r-a-y

Keymaster

`bp_get_member_profile_data` is only specific to one member. It will not grab all users with a certain xprofile field nor is there a built-in function that will do what you want.

I’d write a custom function to return the user IDs that match a certain field. Then use the `include` parameter in the members loop to do what you want to do.

eg. `if ( bp_has_members( ‘include=’ . my_custom_function() ) ) : `

`my_custom_function()` will have to be written!

If you know your way around WordPress, check out the `wp_bp_xprofile_data` table in your DB and a way to query the WPDB for hints. The `xprofile_get_field_id_from_name()` function will help as well.

Skip to toolbar