#22: http_request_timeout

The http_request_timeout filter allows you to set the http request timeout duration in seconds.

It is evaluated in WP_http::request() method, which has a helper function, wp_remote_request() in the wp-includes/http.php file.

http_request_timeout accepts a single argument in the form of an integer that specifies the timeout duration in seconds.


The following example extends the timeout duration from 5 seconds to 30 seconds.

View the code example on Gist.

Have a suggested improvement? You can fork the Gist and comment back with the link. If all is agreeable, I’ll merge in your changes. Crowd-sourced documentation FTW!

Leave a Reply

Your email address will not be published. Required fields are marked *