hook_countries_alter

hook_countries_alter(&$countries)

Alter the default country list.

Parameters

$countries: The associative array of countries keyed by two-letter country code.

See also

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

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/core.api.php, line 2116
Documentation landing page and topics, plus core library hooks.

Code

function hook_countries_alter(&$countries) {
  // Elbonia is now independent, so add it to the country list.
  $countries['EB'] = 'Elbonia';
}
doc_Drupal
2016-10-29 09:17:53
Comments
Leave a Comment

Please login to continue.