Created
January 7, 2017 06:19
-
-
Save jboullion/42d3055bb6a80f621dc83f30f2125cb8 to your computer and use it in GitHub Desktop.
Gravity Forms Description
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
//https://www.gravityhelp.com/documentation/article/gform_save_field_value/ | |
add_filter( 'gform_save_field_value', 'jb_encrypt_value', 10, 4 ); | |
function jb_encrypt_value( $value, $lead, $field, $form ) { | |
if($field->cssClass == 'secure'){ | |
$encrypted = GFCommon::encrypt( $value ); | |
return $encrypted; | |
} | |
return $value; | |
} | |
//https://www.gravityhelp.com/documentation/article/gform_get_input_value/ | |
add_filter( 'gform_get_input_value', 'jb_decrypt_value', 10, 4 ); | |
function jb_decrypt_value( $value, $entry, $field, $input_id ) { | |
if($field->cssClass == 'secure'){ | |
$decrypted = GFCommon::decrypt( $value ); | |
return $decrypted; | |
} | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment