Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created July 16, 2012 17:18
Show Gist options
  • Save mikejolley/3123855 to your computer and use it in GitHub Desktop.
Save mikejolley/3123855 to your computer and use it in GitHub Desktop.
WooCommerce - Malaysia states
/**
* Code goes in functions.php or a custom plugin.
*/
add_filter( 'woocommerce_states', 'malaysia_woocommerce_states' );
function malaysia_woocommerce_states( $states ) {
$states['MY'] = array(
'JHR' => __('Johor', 'woocommerce') ,
'KDH' => __('Kedah', 'woocommerce') ,
'KTN' => __('Kelantan', 'woocommerce') ,
'MLK' => __('Melaka', 'woocommerce') ,
'NSN' => __('Negeri Sembilan', 'woocommerce') ,
'PHG' => __('Pahang', 'woocommerce') ,
'PRK' => __('Perak', 'woocommerce') ,
'PLS' => __('Perlis', 'woocommerce') ,
'PNG' => __('Pulau Pinang', 'woocommerce') ,
'SBH' => __('Sabah', 'woocommerce') ,
'SWK' => __('Sarawak', 'woocommerce') ,
'SGR' => __('Selangor', 'woocommerce') ,
'TRG' => __('Terengganu', 'woocommerce') ,
'KUL' => __('W.P. Kuala Lumpur', 'woocommerce') ,
'LBN' => __('W.P. Labuan', 'woocommerce') ,
'PJY' => __('W.P. Putrajaya', 'woocommerce')
);
return $states;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment