Export user profile fields for map
- This topic has 1 reply, 2 voices, and was last updated 5 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Hi,
I’ve added two custom user fields for Hometown and homestate so I can add these locations to a map. However I cannot seem to find a way to export these fields. Any ideas?
Thanks,
Daniel.
Hi Daniel,
Are you trying to output your custom fields in a template somewhere?
If so, you should be able to use the BuddyPress Profile Fields API functions to output the specific data.
For example, xprofile_get_field_data()
might be the function that you are looking for. Let’s say I created a profile field called “Website” and I want to output the data for the “Website” field for the displayed user.
I could do this:
$url = xprofile_get_field_data( 'Website', bp_displayed_user_id() );
If you want to get the data for a specific user, change bp_displayed_user_id()
to the user ID in question.
Hope that helps.