WC_Geo_IP::geoip_country_code_by_addr
Country code by addr.
Метод класса: WC_Geo_IP{}
Хуков нет.
Возвращает
string.
Использование
$WC_Geo_IP = new WC_Geo_IP(); $WC_Geo_IP->geoip_country_code_by_addr( $addr );
- $addr(строка) (обязательный)
- .
Код WC_Geo_IP::geoip_country_code_by_addr() WC Geo IP::geoip country code by addr WC 11.2.2
public function geoip_country_code_by_addr( $addr ) {
if ( self::GEOIP_CITY_EDITION_REV1 == $this->databaseType ) {
$record = $this->geoip_record_by_addr( $addr );
if ( false !== $record ) {
return $record->country_code;
}
} else {
$country_id = $this->geoip_country_id_by_addr( $addr );
if ( false !== $country_id && isset( $this->GEOIP_COUNTRY_CODES[ $country_id ] ) ) {
return $this->GEOIP_COUNTRY_CODES[ $country_id ];
}
}
return false;
}