Skip to content
Docs
Get RestroPress

Filter

rpress_south_african_states

Updated
On this page

Filters the list of states returned for South Africa.

Applied at the end of rpress_get_south_african_states_list(), which rpress_get_states() calls when the selected country is ZA. 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#

ParameterTypeDescription
$statesarrayAssociative array of province code => name.

Return value#

array. The list of states for South Africa.

Example#

function my_add_south_african_states( $states ) {
	$states['XX'] = 'My Custom Region';
	return $states;
}
add_filter( 'rpress_south_african_states', 'my_add_south_african_states' );

Source#

Applied in:

  • includes/country-functions.php (line 1582), in rpress_get_south_african_states_list()

See also#

Was this page helpful?