Description
This function returns an array containing all states with 'country code + state code' as key and the country name as label.
Usage
$stages = acfcs_get_states( 'NL' );
Returns
array(
'NL-DR' => 'Drenthe',
'NL-FL' => 'Flevoland',
'NL-FR' => 'Friesland',
'NL-GE' => '"Gelderland',
'NL-GR' => 'Groningen',
'NL-LI' => 'Limburg',
'NL-NB' => '"Noord-Brabant',
'NL-NH' => '"Noord-Holland',
'NL-OV' => '"Overijssel',
'NL-UT' => 'Utrecht',
'NL-ZE' => 'Zeeland',
'NL-ZH' => '"Zuid-Holland',
)
This function makes use of a transient, called 'acfcs_states_{$country_code}'.
Arguments
- (string) - $country_code (required)
Country code (exactly 2 characters). - (bool) - $show_first (optional)
Whether to include an empty option (used for dropdowns) | default false. - (bool) - $show_labels (optional)
Whether to show a text in the first option (used for dropdowns) | default false.
Defined in
Used in
- fields/acf-city-selector-v4.php - line 157
- fields/acf-city-selector-v4.php - line 165
- fields/acf-city-selector-v5.php - line 130
- fields/acf-city-selector-v5.php - line 138
- inc/acfcs-ajax.php - line 37