Created
March 18, 2014 12:58
-
-
Save WebEndevSnippets/9619534 to your computer and use it in GitHub Desktop.
Gravity Forms: Assign unique ID to form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('gform_after_submission_3', 'we_add_submission_id', 10, 2); | |
/** | |
* Assign unique ID to the Service & Support form, for Request Number | |
*/ | |
function we_add_submission_id($entry, $form) { | |
global $wpdb; | |
$field_number = 14; | |
$SubmissionID = 'S-' . $entry['id']; | |
$wpdb->insert("{$wpdb->prefix}rg_lead_detail", array( | |
'value' => $SubmissionID, | |
'field_number' => $field_number, | |
'lead_id' => $entry['id'], | |
'form_id' => $entry['form_id'] | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment