Skip to content

Commit 1541584

Browse files
gpapf-save-national-format.php: Added new snippet.
Co-authored-by: Saif Sultan <saif@gravitywiz.com>
1 parent 691469c commit 1541584

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gp-advanced-phone-field/gpapf-save-national-format.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616

1717
$proto = gp_advanced_phone_field()->get_phone_number_proto( $value );
1818
$phone_number_util = \libphonenumber\PhoneNumberUtil::getInstance();
19-
19+
if ( ! $proto ) {
20+
return $value;
21+
}
2022
return $phone_number_util->format( $proto, \libphonenumber\PhoneNumberFormat::NATIONAL );
2123

2224
}, 10, 5 );

0 commit comments

Comments
 (0)