• Go to Formidable Forms Official Site
  •  Login
  •  

Log In

Forgot Password

Search

Formidable Forms Community Site

Rob Butz

Store created post ID in a Formidable Form entry field

Hi folks, I understand how to store "the entry ID of the form submission that created a new post, in one of the post's custom fields," but I don't understand how to go the other way. We have a lot of forms that do different things on the site. For example, only a certain group of forms creates records. To get the form submission entry ID into the created post (specifically, into a field called "form_entry_created_by", I do the following: add_filter( 'frm_new_post', 'frm_save_entry_id_to_custom_field', 10, 2 ); function frm_save_entry_id_to_custom_field( $post, $args ) { $form_key = FrmForm::get_key_by_id( $args['form']->id ); $special_forms = array( 'm_form_new_member', 's_band_aud_form', 's_choir_aud_form', 's_choir_rec_form', 's_jib_app_form', ); if ( in_array( $form_key, $special_forms ) ) { $post['post_custom']['form_entry_created_by'] = $args['entry']->id; } return $post; } But I don't know how to do the reverse - set the newly created post's post ID into a custom field in the Formidable Forms form submission/entry. It seems like it might actually be easy (maybe easier than what I'm attempting) because Formidable Forms does seem to maintain a link between the created post and the form submission. When I delete theĀ form submission that created the post, the post also disappears; and a link to the created post also […]

Navigation

  • Privacy Policy
  • Formidable Forms for WordPress

Discussions

  • An add-on
  • Creating posts/pages
  • Emails
  • Entries
  • Filter & Action Hooks
  • Forms
  • Getting Started
  • Importing/Exporting
  • Javascript
  • Reports, Graphs and Statistics
  • Styles
  • Styling
  • Tips & Tricks
  • Views

Disclaimer

The purpose of this site is to help members of the Formidable Forms Community interact with one another, provide examples of custom code and help others with topics that may not be covered by support on the main Formidable Forms website. If you are seeking support from the Formidable Forms team, please create a ticket on the Formidable Forms website.

Copyright © 2021 Strategy11, LLC