Description
The gform_post_form_trashed action is triggered after a form is moved to trash in Gravity Forms, allowing further actions to be performed.
Usage
add_action( 'gform_post_form_trashed', 'my_function', 10, 1 );
Parameters
| Parameter | Type | Description |
|---|---|---|
$form_id | int | The ID of the form being moved to trash. |
Examples
Perform an action after a form is moved to the trash.
add_action( 'gform_post_form_trashed', 'my_post_form_trashed_func', 10);
function my_post_form_trashed_func( $form_id ) {
// perform action after a form has been moved to the trash
}
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.