Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This hook allows you to something after an entry has been duplicated.
Usage
add_action( 'frm_after_duplicate_entry', 'frm_duplicated_draft', 10, 3 ); function frm_duplicated_draft( $entry_id, $form_id, $args )
Parameters
- $entry_id (int)
- $form_id (int)
- $args (array)
Examples
Set Duplicate Entry to Draft
This example sets the duplicate entry to a draft status after it's creation.
add_action( 'frm_after_duplicate_entry', 'frm_duplicated_draft', 10, 3 );
function frm_duplicated_draft( $entry_id, $form_id, $args ){
if ( $form_id == 5 ) {
global $wpdb;
$wpdb->update( $wpdb->prefix .'frm_items', array('is_draft' => 1), array( 'id' => $entry_id ) );
}
}