WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Geolocation::get_external_ip_address() public WC 1.0

Get user IP Address using an external service. This can be used as a fallback for users on localhost where get_ip_address() will be a local IP and non-geolocatable.

Это метод класса: WC_Geolocation{}

Возвращает

Строку.

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

$result = WC_Geolocation::get_external_ip_address();

Код WC_Geolocation::get_external_ip_address() WC 4.5.2

woocommerce/includes/class-wc-geolocation.php
<?php
public static function get_external_ip_address() {
	$external_ip_address = '0.0.0.0';

	if ( '' !== self::get_ip_address() ) {
		$transient_name      = 'external_ip_address_' . self::get_ip_address();
		$external_ip_address = get_transient( $transient_name );
	}

	if ( false === $external_ip_address ) {
		$external_ip_address     = '0.0.0.0';
		$ip_lookup_services      = apply_filters( 'woocommerce_geolocation_ip_lookup_apis', self::$ip_lookup_apis );
		$ip_lookup_services_keys = array_keys( $ip_lookup_services );
		shuffle( $ip_lookup_services_keys );

		foreach ( $ip_lookup_services_keys as $service_name ) {
			$service_endpoint = $ip_lookup_services[ $service_name ];
			$response         = wp_safe_remote_get( $service_endpoint, array( 'timeout' => 2 ) );

			if ( ! is_wp_error( $response ) && rest_is_ip_address( $response['body'] ) ) {
				$external_ip_address = apply_filters( 'woocommerce_geolocation_ip_lookup_api_response', wc_clean( $response['body'] ), $service_name );
				break;
			}
		}

		set_transient( $transient_name, $external_ip_address, WEEK_IN_SECONDS );
	}

	return $external_ip_address;
}