Skip to content

Commit 7d6697e

Browse files
committed
gw-capitilize-submitted-data.php: Added support to capitalize list fields.
1 parent 121315e commit 7d6697e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gravity-forms/gw-capitilize-submitted-data.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ function gw_capitalize_submitted_data( $form ) {
2727
$_POST[ $input_key ] = ucwords( strtolower( rgpost( $input_key ) ) );
2828
}
2929
} else {
30-
$input_key = sprintf( 'input_%s', $field['id'] );
31-
$_POST[ $input_key ] = ucwords( strtolower( rgpost( $input_key ) ) );
30+
$input_key = sprintf( 'input_%s', $field['id'] );
31+
if ( is_array( $_POST[ $input_key ] ) ) {
32+
$_POST[ $input_key ] = array_map( function( $value ) {
33+
return ucwords( strtolower( $value ) );
34+
}, $_POST[ $input_key ] );
35+
} else {
36+
$_POST[ $input_key ] = ucwords( strtolower( rgpost( $input_key ) ) );
37+
}
3238
}
3339
}
3440

0 commit comments

Comments
 (0)