bp_profile_field_data() is used to output the buddypress xProfile field data. It can be used to retrieve data for any user by setting user_id parameter. The functions outputs the value of field to be used in your buddypress compatible theme.
$args = array( 'field' => 'Field Name' 'user_id => 1, ); bp_profile_field_data( $args );
The function accepts following parameters:
This buddypress function prints the value for corresponding field.
To retrieve the birthday of user having user_id 7, use following code.
//This function will print the value of field. $args = array('field' => 'Birthday', 'user_id' => 7); bp_profile_field_data( $args );
This BP function will output the data, if you want the profile data to be returned for use in PHP than use bp_get_profile_field_data() which accepts same parameters and return the field value.