bp_profile_field_data()

Description Description

Takes a field name and outputs its corresponding field value. Can be specified by user ID.

Top ↑

Usage Usage


$args = array(
‘field’ => ‘Field Name’,
‘user_id’ => 1
);
bp_profile_field_data( $args );

Top ↑

Parameters Parameters

field
(string) Name of profile field to retrieve. The default is false
user_id
(integer) Display field corresponding to a specific user. If no parameter is used, it defaults to bp_displayed_user_id()

Top ↑

Example Example

To get the current user’s ‘Birthday’:

bp_profile_field_data( ‘field=Birthday’ );

To get User 4’s ‘Hire Date’:

bp_profile_field_data( ‘field=Hire Date&user_id=4’ );

Top ↑

Source File Source File

bp_profile_field_data() is located in bp-xprofile/bp-xprofile-template.php