Skip to content

Commit 91b6f40

Browse files
authored
gw-require-unique-values.php: Added support for email field with confirmation.
1 parent 57b61dd commit 91b6f40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gravity-forms/gw-require-unique-values.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function get_filtered_value( $field, $input_id = null ) {
203203
}
204204

205205
// When using a field ID (not input ID) for multi-input fields, combine all subfield values into one for validation.
206-
if ( ! $input_id && is_array( $field->inputs ) && is_array( $value ) ) {
206+
if ( ! $input_id && is_array( $field->inputs ) && is_array( $value ) && $field->type != 'email' ) {
207207
$all_field_ids = $this->get_all_field_ids();
208208
if ( in_array( $field->id, $all_field_ids ) ) {
209209
$combined_parts = array();
@@ -218,6 +218,7 @@ public function get_filtered_value( $field, $input_id = null ) {
218218
}
219219

220220
$value = ! is_array( $value ) ? array( $value ) : $value;
221+
$value = $field->type == 'email' ? array( $value[0] ) : $value;
221222
$value = array_filter( $value );
222223

223224
return $value;

0 commit comments

Comments
 (0)