gform_after_delete_form

gform_after_delete_form

DescriptionUsageParametersExamplesSource Code

Description
Use this action hook to perform actions right after a form is deleted.
Usage
1add_action( 'gform_after_delete_form', 'do_cleanup' );

Parameters

$form_id integer
ID of current form.

Examples
This example adds a log file entry when a form is deleted.
12345678add_action( 'gform_after_delete_form', 'log_form_deleted' );function log_form_deleted( $form_id ) {    $log_file = ABSPATH . '/gf_deleted_forms.log';    $f = fopen( $log_file, 'a' );    $user = wp_get_current_user();    fwrite( $f, date( 'c' ) . " - Form deleted by {$user->user_login}. Form ID: {$form_id}. n" );    fclose( $f );}
Source Code
This action hook is located in GFFormsModel::delete_form() in form_model.php.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注