2017 © Pedro Peláez
 

wordpress-plugin acf-country

Add a country field to ACF (Advanced Custom Fields)

image

hellonico/acf-country

Add a country field to ACF (Advanced Custom Fields)

  • Wednesday, April 25, 2018
  • by hellonico
  • Repository
  • 3 Watchers
  • 44 Stars
  • 5,212 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 6 Open issues
  • 9 Versions
  • 11 % Grown

The README.md

ACF Country field

Latest Version Packagist Beerpay Donate, (*1)

Adds a 'Country' field type for the Advanced Custom Fields WordPress plugin., (*2)

⚠️ WARNING ⚠️

From version 2.0.0, ACF Country introduced some important breaking changes:, (*3)

  • Dropped support for older PHP & ACF versions, new requirements are:
    • ACF 5.7+
    • PHP 5.4+
  • Return format has changed. To better stick to ACF and make use of ACF functions, ACF Country will now return values the same way select field do. ['FR' => 'France'] will now look like ['label' => 'France', 'value' => 'FR']

Looking for a ACF pre 5.7 support? Check the 1.0 branch., (*4)

Overview

Display a select list of all countries in your language., (*5)

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

Select a single value:, (*7)

ACF Country field, (*8)

Or multiple ones:, (*9)

ACF Country field, (*10)

Compatibility

  • ACF 5.7+
  • PHP 5.4+

Field options

Option Default Description
Default value emtpy Set a default value for the country field (as country code)
Allow null false Enable/disable null value
Allow multiple false Enable/disable multiple countries selection
Stylised UI true Enable/disable enhanced select field thanks to Select2
Return format value  See ACF Select field

Filters

You can remove (or add) some countries with the acf/country/countries filter, example:, (*11)

add_filter( 'acf/country/countries', function( $countries ) {
    return array_filter( $countries, function( $code ) {
        return !in_array( $code, ['IC', 'EA'], true );
    }, ARRAY_FILTER_USE_KEY);
} );

Note: PHP5.6+ example, (*12)

Installation

Zip

Download the plugin and extract the archive to your plugins folder., (*13)

Composer

composer require hellonico/acf-country

Contributing

See CONTRIBUTING., (*14)

Support

This ACF field was originally developed for a personal project I don't use anymore. I still decided to maintain it anyway. If you use it in a commercial project, please consider buying me a beer., (*15)

The Versions

25/04 2018

dev-master

9999999-dev https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

25/04 2018

1.3

1.3.0.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

01/04 2018

1.0.0

1.0.0.0

  Sources   Download

09/11 2017

1.2.1

1.2.1.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

03/05 2017

dev-feature-conditional

dev-feature-conditional https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

03/05 2017

1.2

1.2.0.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

31/03 2017

1.1.2

1.1.2.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

The Development Requires

acf country advanced custom fields

03/02 2017

1.1.1

1.1.1.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

acf country advanced custom fields

08/01 2017

1.1.0

1.1.0.0 https://github.com/nlemoine/acf-country

Add a country field to ACF (Advanced Custom Fields)

  Sources   Download

MIT

The Requires

 

acf country advanced custom fields