WC_Countries::country_exists()publicWC 5.1.0

Check if a given code represents a valid ISO 3166-1 alpha-2 code for a country known to us.

Метод класса: WC_Countries{}

Хуков нет.

Возвращает

true|false. True if the country is known to us, false otherwise.

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

$WC_Countries = new WC_Countries();
$WC_Countries->country_exists( $country_code );
$country_code(строка) (обязательный)
The country code to check as a ISO 3166-1 alpha-2 code.

Список изменений

С версии 5.1.0 Введена.

Код WC_Countries::country_exists() WC 9.8.1

public function country_exists( $country_code ) {
	return isset( $this->get_countries()[ $country_code ] );
}