Download the PHP package hellonico/acf-country without Composer

On this page you can find all versions of the php package hellonico/acf-country. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package acf-country

ACF Country field

Latest Version Packagist Coverage Donate Try in WordPress Playground

Adds a 'Country' field type for the Advanced Custom Fields WordPress plugin (free or PRO).

Overview

Display a select list of all countries in your language.

Country names are available in every language (see available list, generated from Unicode CLDR via symfony/intl). By default, country names are localized in your current WordPress language.

Select a single value:

ACF Country field

Or multiple ones:

ACF Country field

Requirements

Field options

Option Default Description
Default value empty Default country, as a country code (e.g. FR)
Allow null false Allow an empty value
Select multiple values false Allow selecting several countries
Stylized UI false Use an enhanced select field (Select2)
Return format array See below

Return formats

Values are stored as ISO 3166-1 alpha-2 codes. get_field() returns, for France:

Return format Value
Country code and name (array) ['value' => 'FR', 'label' => 'France']
Country code (value) 'FR'
Country name (name) 'France'
Country emoji flag (emoji) '🇫🇷'

With multiple values, you get an array of those. Country names use the site language.

Since codes are stored, you can query posts by country:

For a multiple field, values are serialized: compare with 'LIKE' and '"FR"'.

Public functions

Classes and methods marked @internal are not part of the public API and may change in minor versions.

Filters

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

The filter also receives the locale of the list as a second argument. Admin screens use the language of the logged-in user, while values returned by get_field() use the site language.

Integrations

Installation

Zip

Download acf-country.zip from the latest release and extract it to your plugins folder. The "Source code" archives GitHub adds to each release are not installable: they lack the autoloader.

Composer

Composer installs use your project's autoloader: the site must load Composer's vendor/autoload.php, as Bedrock does. Without an autoloader, the plugin shows an admin notice and stays inactive.

Upgrading

From 3.x, see UPGRADE-4.0.

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 supporting it on Open Collective.


All versions of acf-country with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hellonico/acf-country contains the following files

Loading the files please wait ...