http_request_timeout filter-hookWP 2.7.0

Filters the timeout value for an HTTP request.

Usage

add_filter( 'http_request_timeout', 'wp_kama_http_request_timeout_filter', 10, 2 );

/**
 * Function for `http_request_timeout` filter-hook.
 * 
 * @param float  $timeout_value Time in seconds until a request times out.
 * @param string $url           The request URL.
 *
 * @return float
 */
function wp_kama_http_request_timeout_filter( $timeout_value, $url ){

	// filter...
	return $timeout_value;
}
$timeout_value(float)
Time in seconds until a request times out.
Default: 5
$url(string)
The request URL.

Changelog

Since 2.7.0 Introduced.
Since 5.1.0 The $url parameter was added.

Where the hook is called

WP_Http::request()
http_request_timeout
wp-includes/class-wp-http.php 163
'timeout'             => apply_filters( 'http_request_timeout', 5, $url ),

Where the hook is used in WordPress

wp-admin/includes/class-wp-importer.php 200
add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );