Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phillipwilhelm/01b039760f7e3a843c01a91f6dc318ba to your computer and use it in GitHub Desktop.
Save phillipwilhelm/01b039760f7e3a843c01a91f6dc318ba to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Remove query args from Save & Continue's "resume url".
<?php
/**
* Gravity Wiz // Gravity Forms // Remove query args from Save & Continue's "resume url".
*
* If form is access from the url:
*
* http://mysite.com/form-page/?boom=1
*
* Reume URL would be:
*
* http://mysite.com/form-page/
*
*/
add_filter( 'gform_save_and_continue_resume_url', function( $resume_url, $form, $token, $email ) {
// remove specific query arg
//$resume_url = remove_query_arg( array( 'boom' ), $resume_url );
// remove ALL query args
$resume_url = add_query_arg( array( 'gf_token' => $token ), array_shift( explode( '?', $resume_url ) ) );
return $resume_url;
}, 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment