Answer the question
In order to leave comments, you need to log in
How to access additional user profile fields?
Hello. BuddyPress has added some user profile fields via "Advanced Profiles". How to access them for further use? For example, drive them into an array and use as needed?
I think I found it, but I just can't figure out how to display these fields:
function bp_the_profile_field_value() {
echo bp_get_the_profile_field_value();
}
/**
* Returns the XProfile field value.
*
* @return mixed|void
*/
function bp_get_the_profile_field_value() {
global $field;
$field->data->value = bp_unserialize_profile_field( $field->data->value );
/**
* Filters the XProfile field value.
*
* @since 1.0.0
*
* @param string $value Value for the profile field.
* @param string $type Type for the profile field.
* @param int $id ID for the profile field.
*/
return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question