Androlax2 / acf-phone-number

A real ACF phone number field powered by libphonenumber and intl-tel-input

Home Page:https://github.com/log1x/acf-phone-number

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ACF Phone Number

Latest Stable Version Total Downloads Build Status

A real ACF phone number field powered by libphonenumber and intl-tel-input

Screenshot

Requirements

Installation

Bedrock

Install via Composer:

$ composer require log1x/acf-phone-number

Manual

Download the release .zip and install into wp-content/plugins.

Usage

Pretty straight forward usage. You can optionally set a default country.

Calling the field will return an arrayable object containing everything you need about your number:

{
  +"number": "+1 405-867-5309"
  +"country": "US"
  +"uri": "tel:+14058675309"
  +"e164": "+14058675309"
  +"rfc3966": "tel:+1-405-867-5309"
  +"national": "(405) 867-5309"
  +"international": "+1 405-867-5309"
  +"carrier": ""
  +"location": "Oklahoma"
  +"timezone": array:1 [▼
    0 => "America/Chicago"
  ]
}

ACF Composer

If you are on Sage 10 and using my ACF Composer package:

$field
  ->addField('my_number_field', 'phone_number')
    ->setConfig('default_country', 'us');

Bug Reports

If you discover a bug in ACF Phone Number, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

ACF Phone Number is provided under the MIT License.

About

A real ACF phone number field powered by libphonenumber and intl-tel-input

https://github.com/log1x/acf-phone-number

License:MIT License


Languages

Language:PHP 82.1%Language:JavaScript 15.3%Language:SCSS 2.6%