From 6183d0973d861b827a6c6d5d5dc6817ab1e40235 Mon Sep 17 00:00:00 2001 From: Michael Rimbach Date: Thu, 19 Oct 2017 17:16:36 +0200 Subject: [PATCH] Format PL (Poland) Postal Code Add "PL" formatting to wc_format_postcode function. An example pl postal code is 24-100 --- includes/wc-formatting-functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index 843bd79eec5..850319c001c 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -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 );