hellonico/acf-country

Add a country field to ACF (Advanced Custom Fields)

1.3 2018-04-25 11:08 UTC

README

GitHub issues Packagist

Adds a 'Country' field type for the Advanced Custom Fields WordPress plugin.

Overview

Display a select list of all countries in your language.

Country names are available in every language (see available list). By default, country names are localized in your current WordPress language.

Select a single value:

ACF Country field

Or multiple ones:

ACF Country field

Compatibility

This add-on will work with:

  • ACF version 4
  • ACF version 5 (pro)
  • PHP 5.3 or higher

Field options

  • Allow null: enable/disable null value (disabled by default)
  • Allow multiple: enable/disable multiple countries selection (disabled by default)
  • Stylised UI: enable/disable enhanced select field thanks to Select2 (enabled by default)
  • Return format:
    • country code and country name (default):
      • single: array('FR' => 'France')
      • multiple: array('FR' => 'France', 'DE' => 'Germany')
    • country code:
      • single: FR
      • multiple: array('FR', 'DE', 'ES')
    • country name:
      • single: France
      • multiple: array('France', 'Germany', 'Spain')

Installation

Zip

Download the plugin and extract the archive to your plugins folder.

Composer

composer require hellonico/acf-country