bp_xprofile_field_type_set_format

Filters the regex format for the field type.

Description

apply_filters( 'bp_xprofile_field_type_set_format', (string) $format, (string) $replace_format, (BP_XProfile_Field_Type) $instance ); 

Parameters (3)

0. $format (string)
Regex string.
1. $replace_format — Optional. (string)
Replace format If replace,, replaces the format instead of adding to it. Defaults to add..
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. $format = apply_filters( 'bp_xprofile_field_type_set_format', $format, $replace_format, $instance ); 
  2.  
  3. if ( !empty( $format ) ) { 
  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_format callback 
  2. function filter_bp_xprofile_field_type_set_format( $format, $replace_format, $instance ) { 
  3. // make filter magic happen here... 
  4. return $format
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_xprofile_field_type_set_format', 'filter_bp_xprofile_field_type_set_format', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_xprofile_field_type_set_format', 'filter_bp_xprofile_field_type_set_format', 10, 3 ); 

Defined (1)

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

/bp-xprofile/classes/class-bp-xprofile-field-type.php  
  1. $format = apply_filters( 'bp_xprofile_field_type_set_format', $format, $replace_format, $this );