Filter
rpress_canada_provinces
On this page
Filters the list of provinces returned for Canada.
Applied at the end of rpress_get_provinces_list(), which rpress_get_states() calls when the selected country is CA. The array maps a code to a display name (province code => name). Add, remove or rename entries to change what appears in the state selector for this country.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$provinces | array | Associative array of province code => name. |
Return value#
array. The list of provinces for Canada.
Example#
function my_add_canada_provinces( $provinces ) {
$provinces['XX'] = 'My Custom Region';
return $provinces;
}
add_filter( 'rpress_canada_provinces', 'my_add_canada_provinces' );
Source#
Applied in:
includes/country-functions.php(line 523), inrpress_get_provinces_list()
See also#
Was this page helpful?
