Skip to content

Instantly share code, notes, and snippets.

@uamv
Created September 23, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uamv/e5c1f234aa6eecd93b73483373787d22 to your computer and use it in GitHub Desktop.
Save uamv/e5c1f234aa6eecd93b73483373787d22 to your computer and use it in GitHub Desktop.
// apply lowercase to email when saved
add_filter( 'gform_save_field_value', function( $value, $lead, $field, $form, $input_id ) {
if ( $field instanceof GF_Field_Email ) {
GFCommon::log_debug( current_filter() . ': transforming email to lowercase' );
return strtolower( $value );
}
return $value;
}, 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment