bp_get_profile_field_data

Return XProfile field data.

Description

bp_get_profile_field_data( (string) $args = '' ); 

Parameters (1)

0. $args — Optional. (string) => ''
Array of arguments for field data.

Options

  • field (string|int|bool) => ''

    Field identifier.

array(

    /**
     * Field identifier.
     *
     * @type string|int|bool
     * @default ''
     */
    'field' => ''
);        


Usage

  1. if ( !function_exists( 'bp_get_profile_field_data' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-xprofile/bp-xprofile-template.php'; 
  3.  
  4. // Array of arguments for field data. 
  5. $args = array( 
  6. 'field' => '' 
  7. ); 
  8.  
  9. // NOTICE! Understand what this does before running. 
  10. $result = bp_get_profile_field_data($args); 
  11.  

Defined (1)

The function is defined in the following location(s).

/bp-xprofile/bp-xprofile-template.php  
  1. function bp_get_profile_field_data( $args = '' ) { 
  2.  
  3. $r = wp_parse_args( $args, array( 
  4. 'field' => false, // Field name or ID. 
  5. 'user_id' => bp_displayed_user_id() 
  6. ) ); 
  7.  
  8. /** 
  9. * Filters the profile field data. 
  10. * @since 1.2.0 
  11. * @since 2.6.0 Added the `$r` parameter. 
  12. * @param mixed $value Profile data for a specific field for the user. 
  13. * @param array $r Array of parsed arguments. 
  14. */ 
  15. return apply_filters( 'bp_get_profile_field_data', xprofile_get_field_data( $r['field'], $r['user_id'] ), $r );