Set Redirect URL by Entry Value

Code

Filename: gpbua-set-redirect-url-by-entry-value.php

<?php
/**
 * Gravity Perks // GF Better User Activation // Set Redirect URL by Entry Value
 * https://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 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.