Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Log1x/acf-phone-number
A real ACF phone number field powered by libphonenumber and intl-tel-input
https://github.com/Log1x/acf-phone-number
acf acf-field acf-pro wordpress wordpress-plugin
Last synced: 2 months ago
JSON representation
A real ACF phone number field powered by libphonenumber and intl-tel-input
- Host: GitHub
- URL: https://github.com/Log1x/acf-phone-number
- Owner: Log1x
- License: mit
- Created: 2020-08-04T22:35:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-05T04:22:39.000Z (3 months ago)
- Last Synced: 2024-11-05T05:05:25.291Z (3 months ago)
- Topics: acf, acf-field, acf-pro, wordpress, wordpress-plugin
- Language: PHP
- Homepage: https://github.com/log1x/acf-phone-number
- Size: 3.99 MB
- Stars: 115
- Watchers: 11
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# ACF Phone Number
![Latest Stable Version](https://img.shields.io/packagist/v/log1x/acf-phone-number?style=flat-square)
![Total Downloads](https://img.shields.io/packagist/dt/log1x/acf-phone-number?style=flat-square)
![Build Status](https://img.shields.io/github/actions/workflow/status/log1x/acf-phone-number/compatibility.yml?branch=master&style=flat-square)A real ACF phone number field powered by [libphonenumber](https://github.com/giggsey/libphonenumber-for-php) and [intl-tel-input](https://github.com/jackocnr/intl-tel-input)
![Screenshot](https://i.imgur.com/ILmsBHr.gif)
## Requirements
- [PHP](https://secure.php.net/manual/en/install.php) >= 7.2 (with [`php-intl`](https://www.php.net/manual/en/book.intl.php) installed)
- [Composer](https://getcomposer.org/download/)## Installation
### Bedrock
Install via Composer:
```bash
$ 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](https://github.com/Log1x/acf-phone-number/blob/master/src/PhoneNumber.php#L254-L272) object containing everything you need about your number:
```php
^ array:10 [
"carrier" => ""
"country" => "United States"
"e164" => "+14058675309"
"international" => "+1 405-867-5309"
"location" => "Oklahoma"
"national" => "(405) 867-5309"
"rfc3966" => "tel:+1-405-867-5309"
"timezone" => array:1 [
0 => "America/Chicago"
]
"uri" => "tel:+14058675309"
]
```### ACF Composer
If you are on Sage 10 and using my [ACF Composer](https://github.com/log1x/acf-composer) package:
```php
$field
->addField('my_number_field', 'phone_number')
->setConfig('placeholder', '+1 555-555-5555')
->setConfig('default_country', 'us');
```## Bug Reports
If you discover a bug in ACF Phone Number, please [open an issue](https://github.com/log1x/acf-phone-number/issues).
## 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](https://github.com/log1x/acf-phone-number/blob/master/LICENSE.md).