function hook_countries_configuration_options_alter in Countries 7.2
Same name and namespace in other branches
- 8 modules/countries_configuration/countries_configuration.api.php \hook_countries_configuration_options_alter()
An alter hook for hook_countries_configuration_options().
Provides a hook into dynamically changing the settings provided by hook_countries_configuration_options() in relation to a country.
Parameters
array $values: The values with the default values loaded.
string $name: The machine name given to this country configuration set.
array $info: Additional info. Keyed elements are: country - the country object or iso2 code. is_new - flag to check if any data is stored for this country. load_defaults - flag to load default values. This is used by the field settings to ensure that no defaults are loaded into the Field UI area.
1 invocation of hook_countries_configuration_options_alter()
- countries_configuration in modules/
countries_configuration/ countries_configuration.module - Helper function to load country configuration options.
File
- modules/
countries_configuration/ countries_configuration.api.php, line 60 - An overview of the hooks that this module provides.
Code
function hook_countries_configuration_options_alter(&$values, $name, $info) {
if ($name == 'address' && !$info['is_new']) {
if ($overrides = address_country_details($info['country'])) {
$values['labels'] = $overrides['labels'] + $values['labels'];
}
}
}