http_api_transports хук-фильтрWP 3.7.0

Filters which HTTP transports are available and in what order.


add_filter( 'http_api_transports', 'wp_kama_http_api_transports_filter', 10, 3 );

 * Function for `http_api_transports` filter-hook.
 * @param string[] $transports Array of HTTP transports to check.
 * @param array    $args       HTTP request arguments.
 * @param string   $url        The URL to request.
 * @return string[]
function wp_kama_http_api_transports_filter( $transports, $args, $url ){

	// filter...
	return $transports;
Array of HTTP transports to check.
По умолчанию: array contains 'curl' and 'streams', in that order
HTTP request arguments.
The URL to request.

Список изменений

С версии 3.7.0 Введена.

Где вызывается хук

wp-includes/class-wp-http.php 537
$request_order = apply_filters( 'http_api_transports', $transports, $args, $url );

Где используется хук в WordPress

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