Skip to content

Instantly share code, notes, and snippets.

@nciske
Created April 1, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nciske/4ade4ac79cb6a6e93e59 to your computer and use it in GitHub Desktop.
Save nciske/4ade4ac79cb6a6e93e59 to your computer and use it in GitHub Desktop.
Filter retURL
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