Display a Phone Number field which use the Intl Tel Input library.
|Allow Countries||Filter which countries can be chosen|
|Preferred Countries||Define the countries to appear at the top of the list|
|Default Country||Set the initial country selection|
|Geolocation||Lookup the user’s country based on their IP address|
|Native Names||Show native country names|
|National Mode||Allow users to enter national numbers|
|Allow Dropdown||Whether or not to allow the dropdown|
|Separate Dial Code||Display the country dial code next to the selected flag|
|Default Value||Must be international number with prefix. ie: |
|Placeholder||You may use |
|Return Value||Return the phone number array or the phone number|
Value can then be retrieved using the common
get_field() function. Usage example:
$slug = get_field('phone_number'); // +1201-555-0123
We decided to not include that library by default, as it weighs more than 10MB and we want to keep ACF Extended as much lightweight as possible. You can easily include that library using the ACF Extended libphonenumber for PHP addon. Once activated, the field will automatically use the server validation from the library.