Skip to content

Instantly share code, notes, and snippets.

Avatar

Koen koen12344

View GitHub Profile
@koen12344
koen12344 / wp-increase-timeout.php
Last active Oct 5, 2021 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
View wp-increase-timeout.php
<?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;
}