Last active
February 3, 2017 08:12
-
-
Save rynaldos-zz/2237b931a13b5944e2b578ea13e4223c to your computer and use it in GitHub Desktop.
[WooCommerce] Make the State field not required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_billing_fields', 'woo_filter_state_billing', 10, 1 ); | |
add_filter( 'woocommerce_shipping_fields', 'woo_filter_state_shipping', 10, 1 ); | |
function woo_filter_state_billing( $address_fields ) { | |
$address_fields['billing_state']['required'] = false; | |
return $address_fields; | |
} | |
function woo_filter_state_shipping( $address_fields ) { | |
$address_fields['shipping_state']['required'] = false; | |
return $address_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment