Skip to content

Instantly share code, notes, and snippets.

@danielkellyio
Created July 28, 2016 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkellyio/d4e62a19273db91ec75531d3c35a9313 to your computer and use it in GitHub Desktop.
Save danielkellyio/d4e62a19273db91ec75531d3c35a9313 to your computer and use it in GitHub Desktop.
Open a duped form in Gravity Forms
//Open Duped to Edit
add_action( 'gform_after_duplicate_form', 'open_new_form', 10, 2 );
function open_new_form($form_id, $new_id){
$url = $_SERVER['SERVER_NAME'] . "/wp-admin/admin.php?page=gf_edit_forms&id=" . $new_id;
echo "<script>window.location = 'http://$url&duped=true'</script>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment