Last active
April 2, 2019 00:54
-
-
Save codiller/a575af6e64046787e25b5b31b46c188c to your computer and use it in GitHub Desktop.
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
<?php | |
/* | |
* | |
* Save email in a cookie for ActiveCampaign | |
* | |
*/ | |
add_filter( 'gform_save_field_value', 'tlc_save_field_value', 10, 4); | |
function tlc_save_field_value( $value, $lead, $field, $form ) { | |
if ($field['label'] == 'Your Email') { // MAKE SURE THIS MATCHES THE NAME OF YOUR FIELD LABEL IN YOUR FORM | |
setcookie( 'email', htmlspecialchars($value, ENT_QUOTES), time() + 99999999, '/', NULL ); | |
} | |
return $value; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment