Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // more complete version of updating an entry with the entry ID as part of a reference number
- // after the form was submitted
- // change the 19 here to your form ID
- add_action("gform_after_submission_19", "set_reference_number", 10, 2);
- function set_reference_number($entry, $form){
- global $wpdb;
- // which field do you want to add the reference number to? Change 18 here to your field ID
- $field_number = 18;
- // this is the format for the reference number to store
- $reference = 'VSR-' . $entry['id']; // change this to whatever you want to store
- $wpdb->insert("{$wpdb->prefix}rg_lead_detail", array(
- 'value' => $reference,
- 'field_number' => $field_number,
- 'lead_id' => $entry['id'],
- 'form_id' => $entry['form_id']
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement