Skip to content

Instantly share code, notes, and snippets.

@hchouhan
Forked from polevaultweb/dbrains_connection.php
Created August 12, 2016 09:10
Show Gist options
  • Save hchouhan/531666ba715181ae5b857cbe45ecb2d8 to your computer and use it in GitHub Desktop.
Save hchouhan/531666ba715181ae5b857cbe45ecb2d8 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