From 98263a971c88ece0bb1c6ee45c2cd6c629da2c2a Mon Sep 17 00:00:00 2001 From: timoteh Date: Sun, 21 Aug 2022 10:10:42 -0400 Subject: [PATCH] fix(field): Fix validation when phone number is empty (Fixes #35) (#47) --- src/PhoneNumberField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhoneNumberField.php b/src/PhoneNumberField.php index 9fe826e..4131ba2 100644 --- a/src/PhoneNumberField.php +++ b/src/PhoneNumberField.php @@ -153,7 +153,7 @@ public function update_value($value, $post_id, $field) public function validate_value($valid, $value, $field, $input) { if (! is_array($value) || empty($value['number'])) { - return $valid; + return __('The phone number cannot be empty.', 'acf-phone-number'); } if (empty($value['country'])) {