Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_profile_field_data()

Description

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

Usage

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

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()

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' );

Source File

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