Created
May 15, 2014 08:43
-
-
Save yratof/afb46c218d1c42fb0877 to your computer and use it in GitHub Desktop.
Contact Form 7 - Custom Thanks Page
This file contains hidden or 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
on_sent_ok: "location = 'http://www.formless.me/thank-you';" |
This file contains hidden or 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
//This will start a session, then save the posted_data[something] to the session | |
add_action('init', 'myStartSession', 1); | |
add_action('wp_logout', 'myEndSession'); | |
add_action('wp_login', 'myEndSession'); | |
function myStartSession() { | |
if(!session_id()) { | |
session_start(); | |
} | |
} | |
function myEndSession() { | |
session_destroy (); | |
} | |
function set_sessions($cf7){ | |
$_SESSION['formdata'] = $cf7->posted_data['your-name']; | |
return false; | |
} | |
add_action( 'wpcf7_before_send_mail', 'set_sessions' ); |
This file contains hidden or 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
<h1 class="thankyou">Thank You <?php echo $_SESSION['formdata']; ?></h1> | |
<h2 class="thankyou-when">Your form has been successfully submitted! You can expect to hear back from us within 1-2 business days</h2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment