Created
May 15, 2014 12:58
-
-
Save yratof/b3a4dda01c0231a4da7f to your computer and use it in GitHub Desktop.
Extra Contact Form Fields
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-name'] = $cf7->posted_data['your-name']; | |
$_SESSION['formdata-tele'] = $cf7->posted_data['your-telephone']; | |
$_SESSION['formdata-age'] = $cf7->posted_data['your-age']; | |
return false; | |
} | |
add_action( 'wpcf7_before_send_mail', 'set_sessions' ); | |
/****** | |
<?php echo $_SESSION['formdata-name']; ?> | |
<?php echo $_SESSION['formdata-tele']; ?> | |
<?php echo $_SESSION['formdata-age']; ?> | |
*******/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment