Created
May 27, 2016 07:11
-
-
Save DustinHartzler/1e8e347085b3fcd14bc99eda6c4f762f to your computer and use it in GitHub Desktop.
Limit postal codes to 5 digits
This file contains hidden or 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_default_address_fields' , 'custom_override_default_address_fields' ); | |
// Our hooked in function - $address_fields is passed via the filter! | |
function custom_override_default_address_fields( $address_fields ) { | |
$address_fields['postcode']['maxlength'] = 5; | |
return $address_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment