cmb2_save_field_<field_id>

Hooks after save field action.

Description

do_action( 'cmb2_save_field_<field_id>', (bool) $updated, (string) $action, (CMB2_Field) $instance ); 

The dynamic portion(s) of the hook refer to the current field id paramater.

Parameters (3)

0. $updated (bool)
Whether the metadata update action occurred.
1. $action (string)
Action performed. Could be repeatable,, updated., or removed.
2. $instance (CMB2_Field)
Object $field This field object

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'cmb2_save_field_{$field_id}', $updated, $action, $instance ); 
The following example is for adding a hook callback.
  1. // define the cmb2_save_field_<field_id> callback 
  2. function action_cmb2_save_field_field_id( $updated, $action, $instance ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "cmb2_save_field_{$field_id}", 'action_cmb2_save_field_field_id', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "cmb2_save_field_{$field_id}", 'action_cmb2_save_field_field_id', 10, 3 ); 

Defined (1)

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

/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/CMB2_Field.php  
  1. do_action( "cmb2_save_field_{$field_id}", $updated, $action, $this );