WC_Shipping_Zones::get_country_code_from_state_code │ private static │ WC 11.1.0

Get the country code from a state location code.

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

Хуков нет.

Возвращает

string. Country code.

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

$result = WC_Shipping_Zones::get_country_code_from_state_code( $state_code );
$state_code(строка) (обязательный)
State location code.

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

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

Код WC_Shipping_Zones::get_country_code_from_state_code() WC 11.2.2

private static function get_country_code_from_state_code( $state_code ) {
	$state_code_parts = explode( ':', $state_code );

	return $state_code_parts[0] ?? '';
}