Format PL (Poland) Postal Code

Add "PL" formatting to wc_format_postcode function. An example pl postal code is 24-100
This commit is contained in:
Michael Rimbach 2017-10-19 17:16:36 +02:00 committed by GitHub
parent e296a276e3
commit 6183d0973d
1 changed files with 3 additions and 0 deletions

View File

@ -839,6 +839,9 @@ function wc_format_postcode( $postcode, $country ) {
case 'US' :
$postcode = rtrim( substr_replace( $postcode, '-', 5, 0 ), '-' );
break;
case 'PL' :
$postcode = trim( substr_replace( $postcode, '-', 2, 0 ) );
break;
}
return apply_filters( 'woocommerce_format_postcode', $postcode, $country );