Skip to content

Instantly share code, notes, and snippets.

@jboullion
Created January 7, 2017 06:19
Show Gist options
  • Save jboullion/42d3055bb6a80f621dc83f30f2125cb8 to your computer and use it in GitHub Desktop.
Save jboullion/42d3055bb6a80f621dc83f30f2125cb8 to your computer and use it in GitHub Desktop.
Gravity Forms Description
//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