cmb2_override_<field_id>_meta_value

Filter and parameters are documented for 'cmb2_override_meta_value' filter (above).

Description

apply_filters( 'cmb2_override_<field_id>_meta_value', (unknown) $data, (unknown) $this_object_id, (unknown) $a, (unknown) $instance ); 

The dynamic portion(s) of the hook refer to the current field id paramater. Returning a non cmb2_field_no_override_val value will effectively short-circuit the value retrieval.

Parameters (4)

0. $data (unknown)
The data.
1. $this_object_id (unknown)
The this object id.
2. $a (unknown)
The a.
3. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/includes/CMB2_Field.php  
  1. $data = apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this );