Skip to content

Instantly share code, notes, and snippets.

@scyt
Created January 10, 2020 22:02
Show Gist options
  • Save scyt/f81d25b23fd0e283c077d554f520db7f to your computer and use it in GitHub Desktop.
Save scyt/f81d25b23fd0e283c077d554f520db7f to your computer and use it in GitHub Desktop.
<?php
/**
* Gravity Wiz // Gravity Forms // Edit Entry
*
* Edit entry ID specified in field with current form submission.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/...
* @copyright 2019 Gravity Wiz
*/
// Update "123" with your form ID; Update "456" with your field ID.
add_filter( 'gform_entry_id_pre_save_lead_123', 'my_update_entry_on_form_submission', 10, 2 );
function my_update_entry_on_form_submission( $entry_id, $form ) {
$update_entry_id = rgpost( 'input_456' );
return $update_entry_id ? $update_entry_id : $entry_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment