Last active
September 5, 2016 04:08
-
-
Save spivurno/e069130732ce78871dfd to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Remove query args from Save & Continue's "resume url".
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
<?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