From f2bd679b96041a18e999c3ddfac6e47ecdc6c981 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 7 Jul 2012 02:27:13 +0000 Subject: [PATCH] WP_HTTP: Add a filter to WP_HTTP_Proxy::send_through_proxy() to allow for plugins to modify which requests are sent to a proxy dynamically. Fixes #20222 git-svn-id: https://develop.svn.wordpress.org/trunk@21225 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-http.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index 31a13ea6d1..e01a53a879 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -1392,6 +1392,10 @@ class WP_HTTP_Proxy { $home = parse_url( get_option('siteurl') ); + $result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home ); + if ( ! is_null( $result ) ) + return $result; + if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) return false;