cmb2_init_<cmb_id>

Hook during initiation of CMB2 object.

Description

do_action( 'cmb2_init_<cmb_id>', (array) $instance ); 

The dynamic portion(s) of the hook name refer is this meta_box id.

Parameters (1)

0. $instance (array)
This CMB2 object

Usage

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

Defined (2)

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

/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/CMB2.php  
  1. do_action( "cmb2_init_{$this->cmb_id}", $this ); 
/includes/libraries/metabox/includes/CMB2.php  
  1. do_action( "cmb2_init_{$this->cmb_id}", $this );