# wp_safe_remote_get()

URL: https://chugunov.pro/api-wordpress/functions/wp_safe_remote_get/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.6.0.

## Сигнатура

```php
wp_safe_remote_get( string $url, array $args = array() ): array|WP_Error
```

## Описание

This function is ideal when the HTTP request is being made to an arbitrary URL. The URL, and every URL it redirects to, are validated with [wp_http_validate_url()](https://developer.wordpress.org/reference/functions/wp_http_validate_url/) to avoid Server Side Request Forgery attacks (SSRF).

The only supported protocols are `http` and `https`.[See also](#see-also)
- [wp_remote_request()](https://developer.wordpress.org/reference/functions/wp_remote_request/): For more information on the response array format.

- [WP_Http::request()](https://developer.wordpress.org/reference/classes/WP_Http/request/): For default arguments information.

- [wp_http_validate_url()](https://developer.wordpress.org/reference/functions/wp_http_validate_url/): For more information about how the URL is validated.

## Параметры

- `$url` `string` — обязательный. URL для получения.
- `$args` `array` — необязательный, по умолчанию `array()`. Request arguments.
  
  See [WP_Http::request()](https://developer.wordpress.org/reference/classes/wp_http/request/) for information on accepted arguments.

## Возвращаемое значение

`array|WP_Error` — WP_Error WP_Http::__TOKEN_1__

## Исходный код

Файл: `wp-includes/http.php:81`

```php
function wp_safe_remote_get( $url, $args = array() ) {
	$args['reject_unsafe_urls'] = true;
	$http                       = _wp_http_get_object();
	return $http->get( $url, $args );
}
```

## История изменений

- 3.6.0 — Introduced.

## Связанные

Использует: [`_wp_http_get_object`](https://chugunov.pro/api-wordpress/functions/_wp_http_get_object/), `WP_Http`.
Используется в: `WP_Font_Collection::load_from_url`, `WP_REST_URL_Details_Controller::get_remote_url`, [`download_url`](https://chugunov.pro/api-wordpress/functions/download_url/), [`wp_remote_fopen`](https://chugunov.pro/api-wordpress/functions/wp_remote_fopen/), `WP_oEmbed::discover`, `WP_oEmbed::_fetch_with_format`, `wp_xmlrpc_server::pingback_ping`, [`discover_pingback_server_uri`](https://chugunov.pro/api-wordpress/functions/discover_pingback_server_uri/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_safe_remote_get/
