Description
The gform_post_form_deactivated action in Gravity Forms is triggered after an active form is marked as inactive, allowing further actions to be performed.
Usage
add_action( 'gform_post_form_deactivated', 'my_function', 10, 1 );
Parameters
| Parameter | Type | Description |
|---|---|---|
$form_id | int | The ID of the form that is being marked as inactive. |
Examples
Run code after a form is deactivated.
add_action( 'gform_post_form_deactivated', 'my_post_form_deactivated_func', 10);
function my_post_form_deactivated_func( $form_id ) {
// perform action after a form has been deactivated
}
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?
Source Code
This action hook is located in forms_model.php.