Skip to content

Instantly share code, notes, and snippets.

@ofernandolopes
Forked from woogist/functions.php
Last active February 15, 2017 02:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofernandolopes/8cd60a8feddc5ac37d8e to your computer and use it in GitHub Desktop.
Save ofernandolopes/8cd60a8feddc5ac37d8e to your computer and use it in GitHub Desktop.
WooCommerce - Sell in specific States/Provinces/Regions
<?php
/**
* Sell only in Minas Gerais. Brazil
*/
function wc_sell_only_states( $states ) {
$states['BR'] = array(
'MG' => __( 'Minas Gerais', 'woocommerce' ),
);
return $states;
}
add_filter( 'woocommerce_states', 'wc_sell_only_states' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment