Last active
December 14, 2018 09:22
-
-
Save vfontjr/5b0e5e983ca8b0497f530654729d1ba6 to your computer and use it in GitHub Desktop.
Formidable Pro: Retrieve Post ID and add to meta data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('frm_after_create_entry', 'after_entry_created', 30, 2); | |
function after_entry_created($entry_id, $form_id) { | |
global $wpdb; | |
if ( $form_id == 2 ) { | |
$table_name = $wpdb->prefix . 'frm_items'; | |
$post_id = $wpdb->get_var( "SELECT post_id FROM " . $table_name . " where id = " . $entry_id ); | |
FrmEntryMeta::add_entry_meta( $entry_id, 131, "", $post_id); //change 131 to the ID of the field in which you want to store the entry ID | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment