Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DarrylErentzen
Created March 19, 2014 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarrylErentzen/9652556 to your computer and use it in GitHub Desktop.
Save DarrylErentzen/9652556 to your computer and use it in GitHub Desktop.
get ID of post created by Formidable Pro "Create Posts" using 'frm_after_create_entry' hook
function process_form($entry_id, $form_id) {
global $frmdb, $wpdb;
$created_post_id = $wpdb->get_var("SELECT post_id FROM $frmdb->entries WHERE id=".$entry_id."");
// whatever else this function is supposed to do
}
add_action('frm_after_create_entry', 'process_form', 50, 2);
// low priority to ensure that the post has actually been created - careful not to fire too soon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment