Hook after form form has been rendered.


do_action( 'cmb2_after_form', (array) $this_cmb_id, (int) $object_id, (string) $object_type, (array) $instance ); 

Parameters (4)

0. $this_cmb_id (array)
The current box ID
1. $object_id (int)
The ID of the current object
2. $object_type (string)
The type of object you are working with. Usually post (this applies to all post-types). Could also be comment,, user. or options-page.
3. $instance (array)
This CMB2 object


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'cmb2_after_form', $this_cmb_id, $object_id, $object_type, $instance ); 
The following example is for adding a hook callback.
  1. // define the cmb2_after_form callback 
  2. function action_cmb2_after_form( $this_cmb_id, $object_id, $object_type, $instance ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( 'cmb2_after_form', 'action_cmb2_after_form', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'cmb2_after_form', 'action_cmb2_after_form', 10, 4 ); 

Defined (2)

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

  1. do_action( 'cmb2_after_form', $this->cmb_id, $object_id, $object_type, $this ); 
  1. do_action( 'cmb2_after_form', $this->cmb_id, $object_id, $object_type, $this );