# wp_http_supports()

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

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

## Сигнатура

```php
wp_http_supports( array $capabilities = array(), string $url = null ): bool
```

## Описание

Определяет, существует ли HTTP-транспорт, способный обработать этот запрос.

## Параметры

- `$capabilities` `array` — необязательный, по умолчанию `array()`. Массив проверяемых возможностей или массив wp_remote_request() $args.
- `$url` `string` — необязательный, по умолчанию `null`. Если задан, проверяет, требует ли URL SSL, и добавляет это требование в массив возможностей.

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

`bool`

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

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

```php
function wp_http_supports( $capabilities = array(), $url = null ) {
	$capabilities = wp_parse_args( $capabilities );

	$count = count( $capabilities );

	// If we have a numeric $capabilities array, spoof a wp_remote_request() associative $args array.
	if ( $count && count( array_filter( array_keys( $capabilities ), 'is_numeric' ) ) === $count ) {
		$capabilities = array_combine( array_values( $capabilities ), array_fill( 0, $count, true ) );
	}

	if ( $url && ! isset( $capabilities['ssl'] ) ) {
		$scheme = parse_url( $url, PHP_URL_SCHEME );
		if ( 'https' === $scheme || 'ssl' === $scheme ) {
			$capabilities['ssl'] = true;
		}
	}

	return WpOrg\Requests\Requests::has_capabilities( $capabilities );
}
```

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

- 3.2.0 — Introduced.

## Связанные

Использует: [`wp_parse_args`](https://chugunov.pro/api-wordpress/functions/wp_parse_args/).
Используется в: `WP_REST_Pattern_Directory_Controller::get_items`, `WP_Site_Health::get_test_ssl_support`, [`wp_check_php_version`](https://chugunov.pro/api-wordpress/functions/wp_check_php_version/), `WP_Community_Events::get_events`, [`translations_api`](https://chugunov.pro/api-wordpress/functions/translations_api/), [`themes_api`](https://chugunov.pro/api-wordpress/functions/themes_api/), [`get_core_checksums`](https://chugunov.pro/api-wordpress/functions/get_core_checksums/), [`wp_check_browser_version`](https://chugunov.pro/api-wordpress/functions/wp_check_browser_version/), [`plugins_api`](https://chugunov.pro/api-wordpress/functions/plugins_api/), [`wp_get_popular_importers`](https://chugunov.pro/api-wordpress/functions/wp_get_popular_importers/), [`wp_credits`](https://chugunov.pro/api-wordpress/functions/wp_credits/), [`wp_version_check`](https://chugunov.pro/api-wordpress/functions/wp_version_check/), [`wp_update_plugins`](https://chugunov.pro/api-wordpress/functions/wp_update_plugins/), [`wp_update_themes`](https://chugunov.pro/api-wordpress/functions/wp_update_themes/).

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