function hook_countries_alter

Alter the default country list.

Parameters

$countries: The associative array of countries keyed by ISO 3166-1 country code.

See also

\Drupal\Core\Locale\CountryManager::getList().

Related topics

1 invocation of hook_countries_alter()
CountryManager::getList in drupal/core/lib/Drupal/Core/Locale/CountryManager.php
Get an array of country code => country name pairs, altered by alter hooks.

File

drupal/core/modules/system/system.api.php, line 3495
Hooks provided by Drupal core and the System module.

Code

function hook_countries_alter(&$countries) {

  // Elbonia is now independent, so add it to the country list.
  $countries['EB'] = 'Elbonia';
}