From 9a4dae158fd999cae8484a7ebba1135210779254 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 27 Apr 2016 19:20:24 -0300 Subject: [PATCH] Introduces woocommerce_format_postcode filter --- includes/wc-formatting-functions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index fc850aa6436..a7636278782 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -634,7 +634,7 @@ function wc_format_postcode( $postcode, $country ) { $postcode = trim( substr_replace( $postcode, ' ', -3, 0 ) ); } - return $postcode; + return apply_filters( 'woocommerce_format_postcode', $postcode, $country ); } /** @@ -644,8 +644,7 @@ function wc_format_postcode( $postcode, $country ) { * @return string */ function wc_format_phone_number( $tel ) { - $tel = str_replace( '.', '-', $tel ); - return $tel; + return str_replace( '.', '-', $tel ); } /**