gform_post_form_duplicated

Note: This hook replaces the deprecated “gform_after_duplicate_form” hook.

Description

The “gform_post_form_duplicated” action in Gravity Forms is triggered after a form is duplicated, allowing further actions to be performed. The hook provides the ID of the form duplicated and the ID of the new form created.

Usage

add_action( 'gform_post_form_duplicated', 'my_function', 10, 2 );

Parameters

  • $form_id int

    The ID of the form being duplicated.

  • $new_id int

    The ID of the newly created, duplicate form.

Examples

function my_function() {
    //Do something here
}
add_action( 'gform_post_form_duplicated', 'my_function', 10, 2 );

Source Code

This action hook is located in GFFormsModel::duplicate_form() in forms_model.php.