Skip to content

Instantly share code, notes, and snippets.

View koen12344's full-sized avatar

Koen koen12344

View GitHub Profile
@koen12344
koen12344 / wp-increase-timeout.php
Last active October 5, 2021 12:01 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
<?php
//Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'pgmb_http_request_args', 100, 1);
function pgmb_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}