Filter hook 'http_request_timeout'

in WP Core File wp-includes/class-wp-http.php at line 181

View Source

http_request_timeout

Filter Hook
Description
Filters the timeout value for an HTTP request.

Hook Information

File Location wp-includes/class-wp-http.php View on GitHub
Hook Type Filter
Line Number 181

Hook Parameters

Type Name Description
float $timeout_value Time in seconds until a request times out. Default 5.
string $url The request URL.

Usage Examples

Basic Usage
<?php
// Hook into http_request_timeout
add_filter('http_request_timeout', 'my_custom_filter', 10, 2);

function my_custom_filter($timeout_value, $url) {
    // Your custom filtering logic here
    return $timeout_value;
}

Source Code Context

wp-includes/class-wp-http.php:181 - How this hook is used in WordPress core
<?php
 176  			 * @since 5.1.0 The `$url` parameter was added.
 177  			 *
 178  			 * @param float  $timeout_value Time in seconds until a request times out. Default 5.
 179  			 * @param string $url           The request URL.
 180  			 */
 181  			'timeout'             => apply_filters( 'http_request_timeout', 5, $url ),
 182  			/**
 183  			 * Filters the number of redirects allowed during an HTTP request.
 184  			 *
 185  			 * @since 2.7.0
 186  			 * @since 5.1.0 The `$url` parameter was added.

PHP Documentation

<?php
/**
			 * Filters the timeout value for an HTTP request.
			 *
			 * @since 2.7.0
			 * @since 5.1.0 The `$url` parameter was added.
			 *
			 * @param float  $timeout_value Time in seconds until a request times out. Default 5.
			 * @param string $url           The request URL.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-http.php
Related Hooks

Related hooks will be displayed here in future updates.