Created
April 15, 2021 14:41
-
-
Save jrick1229/7c6e6864bbff55690e52c7e4b320c6ee to your computer and use it in GitHub Desktop.
Remove the state field from both shipping and billing details section
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
<?php | |
add_filter( 'woocommerce_billing_fields', 'wc_remove_shipping_billing_state' ); | |
add_filter( 'woocommerce_shipping_fields', 'wc_remove_shipping_billing_state' ); | |
function wc_remove_shipping_billing_state( $fields ) { | |
unset( $fields[ 'billing_state' ] ); | |
unset( $fields[ 'shipping_state' ] ); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment