Skip to content

Instantly share code, notes, and snippets.

@walterebert
Created November 10, 2015 10:24
Show Gist options
  • Save walterebert/6dba5706056b2c1dc3df to your computer and use it in GitHub Desktop.
Save walterebert/6dba5706056b2c1dc3df to your computer and use it in GitHub Desktop.
WordPress snippet: Increase timeout for HTTP requests
<?php
function my_http_api_curl( $handle ) {
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 180 );
curl_setopt( $handle, CURLOPT_TIMEOUT, 180 );
}
add_action( 'http_api_curl', 'my_http_api_curl', 100, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment