Skip to content

Instantly share code, notes, and snippets.

@messica
Created September 13, 2019 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save messica/eb9d0b0bcc710289c51e9cc810e23493 to your computer and use it in GitHub Desktop.
Save messica/eb9d0b0bcc710289c51e9cc810e23493 to your computer and use it in GitHub Desktop.
Use Australian States in dropdown.
<?php
function my_pmpro_states_init() {
add_filter( 'pmpro_state_dropdowns', '__return_true' );
add_filter( 'pmpro_states', 'my_pmpro_states' );
}
add_action( 'init', 'my_pmpro_states_init' );
function my_pmpro_states( $states ) {
$states = array(
'ACT' => 'Australian Capital Territory',
'NSW' => 'New South Wales',
'NT' => 'Northern Territory',
'QLD' => 'Queensland',
'SA' => 'South Australia',
'TAS' => 'Tasmania',
'VIC' => 'Victoria',
'WA' => 'Western Australia',
);
return $states;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment