Created
December 18, 2018 03:57
-
-
Save harishankerr/7f56e18a23e33cbb96abf00f8f959071 to your computer and use it in GitHub Desktop.
Make State Field Mandatory For WooCommerce
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
// Hook in | |
add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_state_fields' ); | |
// Our hooked in function - $state_fields is passed via the filter! | |
function custom_override_default_state_fields( $state_fields ) { | |
$state_fields['state']['required'] = true; | |
return $state_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment