Created
April 1, 2015 19:38
-
-
Save nciske/4ade4ac79cb6a6e93e59 to your computer and use it in GitHub Desktop.
Filter retURL
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
add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_field_urlredirect', 10, 3 ); | |
function salesforce_w2l_field_urlredirect( $val, $field, $form ){ | |
$postid = get_the_id(); | |
// Target a specific field on all forms | |
if( $field == 'retURL' ){ | |
if( $field == 'retURL' && $postid == '671' ) { | |
$URL = 'http://www.mycompany.com/thank-you?option=1' ; | |
else if( $field == 'retURL' && $postid == '669' ) { | |
$URL = 'http://www.mycompany.com/thank-you?option=2' ; | |
else if ( $field == 'retURL' && $postid == '360' ) { | |
$URL = 'http://www.mycompany.com/thank-you?option=3' ; | |
else if ( $field == 'retURL' && $postid == '360' ) { | |
$URL = 'http://www.mycompany.com/thank-you?option=4' ; | |
} | |
if( $URL ) | |
$val = $URL; | |
} | |
return $val; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment