Automattic\WooCommerce\Gateways\PayPal

AddressRequirements::country_requires_postal_codepublicWC 1.0

Check if a country requires a postal code in the address.

Method of the class: AddressRequirements{}

No Hooks.

Returns

true|false.

Usage

$AddressRequirements = new AddressRequirements();
$AddressRequirements->country_requires_postal_code( $country_code );
$country_code(string) (required)
The ISO 3166-1 alpha-2 country code.

AddressRequirements::country_requires_postal_code() code WC 10.4.3

public function country_requires_postal_code( string $country_code ) {
	return in_array( strtoupper( $country_code ), self::COUNTRIES_REQUIRING_POSTAL_CODE, true );
}