http_api_transports filter-hookWP 3.7.0

Deprecated from version 6.4.0. It is no longer supported and can be removed in future releases. Use WpOrg\Requests\Requests::get_transport_class() instead.

Filters which HTTP transports are available and in what order.


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

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

	// filter...
	return $transports;
Array of HTTP transports to check.
Default: array contains 'curl' and 'streams', in that order
HTTP request arguments.


Since 3.7.0 Introduced.
Deprecated since 6.4.0 Use WpOrg\Requests\Requests::get_transport_class()

Where the hook is called

wp-includes/class-wp-http.php 541
$request_order = apply_filters_deprecated( 'http_api_transports', array( $transports, $args, $url ), '6.4.0' );

Where the hook is used in WordPress

Usage not found.