Skip to content

Commit

Permalink
fix(field): Fix validation when phone number is empty (Fixes #35) (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
timoteh authored Aug 21, 2022
1 parent 72c7816 commit 98263a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhoneNumberField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down

0 comments on commit 98263a9

Please sign in to comment.