xprofile_filtered_data_value_before_save

Filters the kses-filtered data before saving to database.

Description

apply_filters( 'xprofile_filtered_data_value_before_save', (string) $filtered_field_value, (string) $field_value, (BP_XProfile_ProfileData) $data_obj ); 

Parameters (3)

0. $filtered_field_value (string)
The filtered field value.
1. $field_value (string)
The original value before filtering.
2. $data_obj (BP_XProfile_ProfileData)
The BP_XProfile_ProfileData object.

Usage

To run the hook, copy the example below.
  1. $filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value, $data_obj ); 
  2.  
  3. if ( !empty( $filtered_field_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_filtered_data_value_before_save callback 
  2. function filter_xprofile_filtered_data_value_before_save( $filtered_field_value, $field_value, $data_obj ) { 
  3. // make filter magic happen here... 
  4. return $filtered_field_value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'xprofile_filtered_data_value_before_save', 'filter_xprofile_filtered_data_value_before_save', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'xprofile_filtered_data_value_before_save', 'filter_xprofile_filtered_data_value_before_save', 10, 3 ); 

Defined (2)

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

/bp-xprofile/bp-xprofile-filters.php  
  1. $filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value, $data_obj ); 
  1. $filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value, $data_obj );