Created
February 28, 2014 03:54
-
-
Save mikeselander/9264922 to your computer and use it in GitHub Desktop.
Show a custom confirmation based on which page the form is submitted on with gform_confirmation
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
/** | |
* Dual confirmation message | |
* | |
* @since 0.1.0 | |
* | |
*/ | |
add_filter("gform_confirmation_10", "bid_confirmation", 10, 4); | |
function bid_confirmation( $confirmation, $form, $lead, $ajax ){ | |
// If this is the correct page, re-direct back to our page w/ lead info | |
if ( is_page('332') ){ | |
$confirmation = array( "redirect" => site_url() . "/dashboard/auctions/#".$lead[3] ); | |
// Else show our confirmation text | |
} else { | |
$confirmation = "<p>You have placed a bid on the auction. You will be emailed if you are outbid and the owner will contact you if you have been chosen.</p> | |
<p> | |
To monitor this auction or place another bid, go to <a href='".site_url()."/dashboard/auctions/#".$lead[3]."'>My Auctions.</a></p>"; | |
} | |
return $confirmation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment