|
/ Documentation /Developer Hooks & Events/ suredonation_after_form_duplicated Action Hook

suredonation_after_form_duplicated Action Hook

Overview

The suredonation_after_form_duplicated action fires at the end of the form-duplication routine — after the new form post has been created, its content references rewritten, and all copyable post meta copied. Use it to duplicate any related data or meta your extension attaches to a form.

Hook Signature

do_action( 'suredonation_after_form_duplicated', $new_form_id, $form_id );

Parameters

  • $new_form_id _(int)_ – The post ID of the newly created duplicate form.
  • $form_id _(int)_ – The post ID of the original form that was duplicated.

Usage

add_action( 'suredonation_after_form_duplicated', 'your_custom_function', 10, 2 );

function your_custom_function( $new_form_id, $form_id ) {

    // Your custom logic here.

}

Example

add_action( 'suredonation_after_form_duplicated', 'mysite_copy_custom_meta', 10, 2 );

function mysite_copy_custom_meta( $new_form_id, $form_id ) {

    $value = get_post_meta( $form_id, '_mysite_custom_setting', true );

    if ( '' !== $value ) {

        update_post_meta( $new_form_id, '_mysite_custom_setting', $value );

    }

}

Related Hooks

suredonation_allowed_form_blocks

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top