cmb_validate_<field_type>

The BuddyPress Profile Tabs cmb validate field type hook.

Description

apply_filters( 'cmb_validate_<field_type>', (null) $null, (unknown) $value, (unknown) $this_object_id, (unknown) $this_field_args, (unknown) $instance ); 

Parameters (5)

0. $null (null) => null
The null.
1. $value (unknown)
The value.
2. $this_object_id (unknown)
The this object id.
3. $this_field_args (unknown)
The this field args.
4. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/admin/includes/CMBF/helpers/cmb_Meta_Box_Sanitize.php  
  1. $updated = apply_filters( 'cmb_validate_'. $this->field->type(), null, $value, $this->object_id, $this->field->args(), $this );