Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://www.gravityhelp.com/forums/topic/put-form-entry-url-into-form-field
- // change the 12 here to your form ID.
- add_action('gform_after_submission_12', 'add_edit_link', 10, 2);
- function add_edit_link($entry, $form) {
- global $wpdb;
- // update this number 6 to the number of the hidden field in your form
- $field_number = 6;
- // the Gravity Forms admin entry edit URL into the hidden field
- $edit_url= 'http://www.website.com/wp-admin/admin.php?page=gf_entries&view=entry&id=' . $entry['form_id'] . '&lid=' . $entry['id'];
- // update the entry
- $wpdb->insert("{$wpdb->prefix}rg_lead_detail", array(
- 'value' => $edit_url,
- 'field_number' => $field_number,
- 'lead_id' => $entry['id'],
- 'form_id' => $entry['form_id']
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement