Skip to content

Commit be4d115

Browse files
committed
Enable validation for the required field regardless of it is set for include or not.
1 parent 9f698fb commit be4d115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mailchimp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ function mailchimp_sf_merge_submit( $mv ) {
987987
*/
988988
case 'phone':
989989
if (
990-
'on' === get_option( $opt )
990+
( 'on' === get_option( $opt ) || $mv_var['required'] )
991991
&& isset( $mv_var['options']['phone_format'] )
992992
&& 'US' === $mv_var['options']['phone_format']
993993
) {
@@ -1006,7 +1006,7 @@ function mailchimp_sf_merge_submit( $mv ) {
10061006
* - Merge field is an array (address contains multiple <input> elements)
10071007
*/
10081008
case 'address':
1009-
if ( 'on' === get_option( $opt ) && is_array( $opt_val ) ) {
1009+
if ( ( 'on' === get_option( $opt ) || $mv_var['required'] ) && is_array( $opt_val ) ) {
10101010
$validate = mailchimp_sf_merge_validate_address( $opt_val, $mv_var );
10111011
if ( is_wp_error( $validate ) ) {
10121012
return $validate;

0 commit comments

Comments
 (0)