Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Formidable Pro: Retrieve Post ID and add to meta data
<?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