xprofile_get_field_data

Filters the field data value for a specific field for the user.

Description

apply_filters( 'xprofile_get_field_data', (string) $value, (int) $field_id, (int) $user_id ); 

Parameters (3)

0. $value (string)
Value saved for the field.
1. $field_id (int)
ID of the field being displayed.
2. $user_id (int)
ID of the user being displayed.

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id ); 
  2.  
  3. if ( !empty( $value ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the xprofile_get_field_data callback 
  2. function filter_xprofile_get_field_data( $value, $field_id, $user_id ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'xprofile_get_field_data', 'filter_xprofile_get_field_data', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'xprofile_get_field_data', 'filter_xprofile_get_field_data', 10, 3 ); 

Defined (2)

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

/bp-xprofile/bp-xprofile-functions.php  
  1. $data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id ); 
  1. $data = apply_filters( 'xprofile_get_field_data', $values, $field_id, $user_id );