bp_xprofile_field_type_set_whitelist_values

Filters values for field type's whitelist that profile data will be asserted against.

Description

apply_filters( 'bp_xprofile_field_type_set_whitelist_values', (string) $value, (array) $values, (BP_XProfile_Field_Type) $instance ); 

Parameters (3)

0. $value (string)
Field value.
1. $values (array)
Original array of values.
2. $instance (BP_XProfile_Field_Type)
Current instance of the BP_XProfile_Field_Type class.

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'bp_xprofile_field_type_set_whitelist_values', $value, $values, $instance ); 
  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 bp_xprofile_field_type_set_whitelist_values callback 
  2. function filter_bp_xprofile_field_type_set_whitelist_values( $value, $values, $instance ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_xprofile_field_type_set_whitelist_values', 'filter_bp_xprofile_field_type_set_whitelist_values', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_xprofile_field_type_set_whitelist_values', 'filter_bp_xprofile_field_type_set_whitelist_values', 10, 3 ); 

Defined (1)

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

/bp-xprofile/classes/class-bp-xprofile-field-type.php  
  1. $this->validation_whitelist[] = apply_filters( 'bp_xprofile_field_type_set_whitelist_values', $value, $values, $this );