hook_countries_alter

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 hook_countries_alter(&$countries)

Alter the default country list.

Parameters

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

See also

country_get_list()

_country_get_predefined_list()

Related topics

Code

modules/system/system.api.php, line 4399

<?php
function hook_countries_alter(&$countries) {
  // Elbonia is now independent, so add it to the country list.
  $countries['EB'] = 'Elbonia';
}
?>