Skip to content

Instantly share code, notes, and snippets.

@jeherve jeherve/plugin.php
Last active May 24, 2019

Embed
What would you like to do?
Remove state field from woocommerce checkout form.
<?php
/**
* Remove state field from woocommerce checkout form.
*
* @see https://github.com/woocommerce/woocommerce/blob/3.1.2/includes/class-wc-countries.php#L629
*
* @param array $fields Array of default address fields.
*/
function jeherve_remove_state_field( $fields ) {
unset( $fields['state'] );
return $fields;
}
add_filter( 'woocommerce_default_address_fields', 'jeherve_remove_state_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.