All Projects → nlemoine → acf-country

nlemoine / acf-country

Licence: other
ACF Country field - Display a select field of all countries, in any language.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to acf-country

acf-typography
A Typography Add-on for the Advanced Custom Fields Plugin
Stars: ✭ 14 (-86.41%)
Mutual labels:  wordpress-plugin, acf, advanced-custom-fields
acf-field-boilerplate
Modernized PSR-2 boilerplate for creating custom fields for ACF5.
Stars: ✭ 54 (-47.57%)
Mutual labels:  wordpress-plugin, acf, advanced-custom-fields
acf-swatch
ACF Color Swatch Field
Stars: ✭ 67 (-34.95%)
Mutual labels:  wordpress-plugin, acf, advanced-custom-fields
Acf To Rest Api
Exposes Advanced Custom Fields Endpoints in the WordPress REST API
Stars: ✭ 1,152 (+1018.45%)
Mutual labels:  wordpress-plugin, acf
bea-beautiful-flexible
Transform ACF's flexible layouts list into a nice and UX popup.
Stars: ✭ 19 (-81.55%)
Mutual labels:  wordpress-plugin, acf
acf-phone-number
A real ACF phone number field powered by libphonenumber and intl-tel-input
Stars: ✭ 68 (-33.98%)
Mutual labels:  wordpress-plugin, acf
Fewbricks
Write code to create ACF field groups, fields and re-usable modules.
Stars: ✭ 100 (-2.91%)
Mutual labels:  wordpress-plugin, acf
Acf Codifier
A wrapper class to help write more readable ACF field declarations.
Stars: ✭ 114 (+10.68%)
Mutual labels:  wordpress-plugin, acf
Acf Star Rating Field
A simple star rating field for ACF.
Stars: ✭ 94 (-8.74%)
Mutual labels:  wordpress-plugin, acf
Acf Options For Polylang
A WordPress plugin for adding ACF options page support for Polylang.
Stars: ✭ 131 (+27.18%)
Mutual labels:  wordpress-plugin, acf
acf-field-group-composer
Configuration builder for advanced custom fields field groups
Stars: ✭ 37 (-64.08%)
Mutual labels:  acf, advanced-custom-fields
acf-flexible-content-preview
Transforms ACF's flexible content field's layout list into a modal with image previews.
Stars: ✭ 21 (-79.61%)
Mutual labels:  wordpress-plugin, acf
acf-recaptcha
Google reCAPTCHA plugin for Advanced Custom Fields on WordPress
Stars: ✭ 29 (-71.84%)
Mutual labels:  wordpress-plugin, advanced-custom-fields
Acf Quickedit Fields
WordPress Plugin implementing Column Displaying, QuickEdit and BulkEdit for Advanced Custom Fields (ACF)
Stars: ✭ 328 (+218.45%)
Mutual labels:  wordpress-plugin, acf
acf-image-aspect-ratio-crop
Image Aspect Ratio Crop field for Advanced Custom Fields
Stars: ✭ 100 (-2.91%)
Mutual labels:  acf, advanced-custom-fields
acf-conditional-logic-advanced
Advanced Custom Fields - Conditional Logic Advanced
Stars: ✭ 31 (-69.9%)
Mutual labels:  acf, advanced-custom-fields
flexible-templates
Allows saving templates of the "Flexible Content" field, for easy and fast use of them on other pages.
Stars: ✭ 36 (-65.05%)
Mutual labels:  wordpress-plugin, acf
wp-boilerplate-plugin-with-vuejs
This is an example plugin for Wp plugin developer.
Stars: ✭ 26 (-74.76%)
Mutual labels:  wordpress-plugin
WPFBOGP
WordPress Open Graph plugin development
Stars: ✭ 13 (-87.38%)
Mutual labels:  wordpress-plugin
debugpress
DebugPress is easy to use plugin implementing popup for debugging currently loaded WordPress page with support for intercepting AJAX requests.
Stars: ✭ 19 (-81.55%)
Mutual labels:  wordpress-plugin

ACF Country field

Latest Version Packagist Beerpay Donate

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

⚠️ WARNING ⚠️

From version 2.0.0, ACF Country introduced some important breaking changes:

  • 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.

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

  • 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:

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

Installation

Zip

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

Composer

composer require hellonico/acf-country

Contributing

See CONTRIBUTING.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].