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'; }
Please login to continue.