Created
November 22, 2018 14:55
-
-
Save spivurno/1513f1b735844a8aa22386b43490e5fd to your computer and use it in GitHub Desktop.
Gravity Perks // GF Better User Activation // Set Redirect URL by Entry Value
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 Perks // GF Better User Activation // Set Redirect URL by Entry Value | |
* http://gravitywiz.com/documentation/gravity-forms-better-user-activation/ | |
*/ | |
add_filter( 'gpbua_activation_redirect_url', function( $url, $activation ) { | |
/** | |
* @var $activation GPBUA_Activate | |
*/ | |
$entry = $activation->get_signup()->lead; | |
// Update "123" to your target form ID. | |
if( $entry['form_id'] == 123 ) { | |
// Update "1" to the field ID containing the page ID to which you would like to redirect. | |
$url = get_permalink( $entry[1] ); | |
} | |
return $url; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-better-user-activation/gpbua-set-redirect-url-by-entry-value.php