Tidy Up Fluent Forms Submissions
Trims spaces and lowercases email addresses in Fluent Forms submissions before they are saved, so entries and exports stay consistent.
Opens WPIDE on
Code
add_filter( 'fluentform/insert_response_data', function ( $data ) {
foreach ( (array) $data as $key => $value ) {
if ( ! is_string( $value ) || 0 === strpos( (string) $key, '_' ) ) {
continue;
}
$value = trim( $value );
$data[ $key ] = false !== stripos( (string) $key, 'email' ) ? strtolower( $value ) : $value;
}
return $data;
} );
Notes
Field names containing "email" are lowercased; other text fields are trimmed only.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.