Skip to content

Commit 0fca2d7

Browse files
committed
Fix PHP warning.
1 parent a28b1ca commit 0fca2d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mailchimp/mailchimp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ public function post( $endpoint, $body, $method = 'POST' ) {
188188
foreach ( $merges as $merge ) {
189189
if ( empty( $body['errors'] ) ) {
190190
// Email address doesn't come back from the API, so if something's wrong, it's that.
191-
$field_name = 'Email Address';
192-
$body['errors'][0]['message'] = 'Please fill out a valid email address.';
193-
} elseif ( $merge['tag'] === $body['errors'][0]['field'] ) {
191+
$field_name = esc_html__( 'Email Address', 'mailchimp' );
192+
$body['errors'][0]['message'] = esc_html__( 'Please fill out a valid email address.', 'mailchimp' );
193+
} elseif ( ! empty( $body['errors'] ) && isset( $body['errors'][0]['field'] ) && $merge['tag'] === $body['errors'][0]['field'] ) {
194194
$field_name = $merge['name'];
195195
}
196196
}

0 commit comments

Comments
 (0)