Skip to content

Instantly share code, notes, and snippets.

@polevaultweb
Created April 19, 2016 07:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save polevaultweb/563fe6abdfd88c20e80c1050021b5552 to your computer and use it in GitHub Desktop.
Save polevaultweb/563fe6abdfd88c20e80c1050021b5552 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: DBI Connection Fix
Author: Delicious Brains
Author URI: http://deliciousbrains.com
*/
function dbi_connection( $transports, $args, $url ) {
if ( false !== strpos( $url, 'deliciousbrains.com' ) ) {
// Use streams as cURL results in connection refused
return array( 'streams', 'curl' );
}
return $transports;
}
add_filter( 'http_api_transports', 'dbi_connection', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment