WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wc_format_postcode() WC 1.0

Format the postcode according to the country and length of the postcode.

Хуки из функции
Возвращает

Строку.

Использование

wc_format_postcode( $postcode, $country );
$postcode(строка) (обязательный)
Unformatted postcode.
$country(строка) (обязательный)
Base country.

Код wc_format_postcode() WC 4.5.2

woocommerce/includes/wc-formatting-functions.php
<?php
function wc_format_postcode( $postcode, $country ) {
	$postcode = wc_normalize_postcode( $postcode );

	switch ( $country ) {
		case 'CA':
		case 'GB':
			$postcode = substr_replace( $postcode, ' ', -3, 0 );
			break;
		case 'IE':
			$postcode = substr_replace( $postcode, ' ', 3, 0 );
			break;
		case 'BR':
		case 'PL':
			$postcode = substr_replace( $postcode, '-', -3, 0 );
			break;
		case 'JP':
			$postcode = substr_replace( $postcode, '-', 3, 0 );
			break;
		case 'PT':
			$postcode = substr_replace( $postcode, '-', 4, 0 );
			break;
		case 'US':
			$postcode = rtrim( substr_replace( $postcode, '-', 5, 0 ), '-' );
			break;
		case 'NL':
			$postcode = substr_replace( $postcode, ' ', 4, 0 );
			break;
	}

	return apply_filters( 'woocommerce_format_postcode', trim( $postcode ), $country );
}