bp_xprofile_field_type_is_valid

Filters whether or not field type is a valid format.

Description

apply_filters( 'bp_xprofile_field_type_is_valid', (bool) $validated, (string|array) $values, (BP_XProfile_Field_Type) $instance ); 

Parameters (3)

0. $validated (bool)
Whether or not the field type is valid.
1. $values (string|array)
Value to check against the registered formats.
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. $validated = apply_filters( 'bp_xprofile_field_type_is_valid', $validated, $values, $instance ); 
  2.  
  3. if ( !empty( $validated ) ) { 
  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_is_valid callback 
  2. function filter_bp_xprofile_field_type_is_valid( $validated, $values, $instance ) { 
  3. // make filter magic happen here... 
  4. return $validated
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_xprofile_field_type_is_valid', 'filter_bp_xprofile_field_type_is_valid', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_xprofile_field_type_is_valid', 'filter_bp_xprofile_field_type_is_valid', 10, 3 ); 

Defined (1)

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

/bp-xprofile/classes/class-bp-xprofile-field-type.php  
  1. return (bool) apply_filters( 'bp_xprofile_field_type_is_valid', $validated, $values, $this );