WC_Shipping_Zones::get_country_code_from_state_code
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 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] ?? '';
}