ias_cntrs_get_country_code ( $country, $lang )
Get country code for exactly given country name
'lang' - optional.
ias_cntrs_search_country_code ( $country_code, $lang )
Find all matches of country code by giving country name (or part of it)
'lang' - optional.
ias_cntrs_get_country_slug ( $country_code )
Get url compatible name of country ( $slug )
ias_cntrs_get_country_by_code ( $country_code, $lang )
Get country name by its ISO code
'lang' - optional. If language not defined, country returned in default language from built-in translation version.
ias_cntrs_get_country_by_slug ( $slug, $lang )
Get country name by its slug (url compatible name)
For predefined country slugs look into plugin subfolder /assets/xml/default.xml or database table 'ias_cntrs_table_base'
'lang' - optional.
ias_cntrs_get_countries_by_region ( $region, $lang )
Get countries of given region
'lang' - optional. If language not defined, countries returned in default language from built-in translation version.
ias_cntrs_get_selection ( $selection_id, $lang )
Get countries of the given selection
See bellow for parameter description.
'lang' - optional. If language not defined, countries returned in default language from built-in translation version.
ias_cntrs_get_translations ( $include )
Get all available translations for the given set of countries
See bellow for parameter description.
ias_cntrs_get_translated_countries ( $lang )
Get only translated terms for the given language
ias_cntrs_get_countries ( $args )
Get countries according to given arguments
$args = array(
'lang' => null,
'include' => null,
'exclude' => null,
'selection' => null,
'region' => null,
'orderby' => 'name',
'order' => 'ASC',
'fallback' => false,
'incl_empty' => true
);
ias_cntrs_get_dropdown ( $header, $args )
Return drop-down list
$args = array(
// input field specific
'name' => 'country',
'id' => '',
'class' => '',
'selected' => array(),
'multiple' => false,
'top' => array(),
// country specific (see above)
'lang' => null,
'include' => null,
'exclude' => null,
'selection' => null,
'region' => null,
'orderby' => 'name',
'order' => 'ASC',
'fallback' => false
);
ias_cntrs_dropdown ( $header, $args )
Echo drop-down list
if(function_exists('ias_cntrs_get_countries')){
$args = array(
'lang' => 'de',
'include' => array('DE', 'FR', 'AT')
);
$countries = ias_cntrs_get_countries($args);
}
ias_cntrs_languages_list
Filter list of languages offered for custom translation
Add to functions.php
if(class_exists('iasCountries')){
add_filter('ias_cntrs_languages_list', 'my_langs');
function my_langs($languages){
$languages['ho'] = 'Hiri Motu';
ksort($languages);
return $languages;
}
}
Add new languages in accordance with ISO 639-1 codes.
Formats accepted for translation import: xml, csv.
... AW:Aruba AU:Australia ...
... AW;Aruba AU;Australia ...
<?xml version="1.0" encoding="UTF-8"?>
<countries xml:id="en">
...
<AW>Aruba</AW>
<AU>Australia</AU>
...
</countries>