wp_safe_remote_head()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_safe_remote_head( 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() to avoid Server Side Request Forgery attacks (SSRF).
The only supported protocols are http and https.
- wp_remote_request(): For more information on the response array format.
- WP_Http::request(): For default arguments information.
- wp_http_validate_url(): For more information about how the URL is validated.
Параметры
$url
string
обязательный
$args
array
необязательный
= array()
See WP_Http::request() for information on accepted arguments.
Возвращаемое значение
array|WP_Error
Исходный код
wp-includes/http.php:139
function wp_safe_remote_head( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
$http = _wp_http_get_object();
return $http->head( $url, $args );
}
История изменений
| Версия | Описание |
|---|---|
| 3.6.0 | Introduced. |

