Add unique ID to the insert query
-
I’m trying to add a unique ID to the submission. All the fields that are submitted at once should have the same ID. Of course this is possible by just using the timestamp, but I would rather have a 100% unique ID.
Now, it’s not that hard to do that by editing the core files of the plugin, but that’s not the way i would want to do that.
In the file CF7DBPLugin.php after line 701 i can add:
$my_post = array( 'post_type' => 'cf7_submits', 'post_content' => (int)$post[ 'form_id' ], ); $submissionID = wp_insert_post( $my_post );and edit the query on line 727 to add this $submissionID.
Now the real question is, how can i do this without editing the plugin’s files? Preferrably using hooks.
https://wordpress.org/plugins/contact-form-7-to-database-extension/
The topic ‘Add unique ID to the insert query’ is closed to new replies.