add_action('frm_after_create_entry', 'save_post_id', 60, 2);
function save_post_id( $entry_id, $form_id ) {
if ( $form_id == 341 ) {// Replace 341 with the ID of your form
$entry = FrmEntry::getOne( $entry_id );
if ( ! $entry->post_id ) {
return;
}
FrmEntryMeta::add_entry_meta( $entry_id, 1290, "", $entry->post_id); // Replace 1290 with the ID of the field where the postID should be saved
}
}
I am using this snippet exactly as written (with the correct form and field ids, of course), but post_id is not getting stored.
So I added an else clause to print_r the $entry to the error_log, and behold, the post_id is not even there.
[06-Jan-2025 15:05:07 UTC] stdClass ObjectWhen you want to display a post_id, Formidable provides the [post_id] shortcode.
Provide a screen print of you have the add-on configured, please.
Please login or Register to submit your answer