Description
The gravityflow_pre_cancel_workflow action hook fires just before a workflow is cancelled.
Parameters
Parameter | Type | Details |
---|---|---|
$entry | Entry | The current entry. |
$form | Form | The current form. |
$step | Step | The current step. |
Examples
1 2 3 4 5 | add_action( 'gravityflow_pre_cancel_workflow' , 'sh_gravityflow_pre_cancel_workflow' , 10, 3 ); function sh_gravityflow_pre_cancel_workflow( $entry , $form , $step ) { $note = esc_html__( 'Custom message when workflow cancelled' , 'gravityflow' ) . ': ' . $current_step ->get_name(); $current_step ->add_note( $note ); } |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?