pre_http_send_through_proxy

Filters whether to preempt sending the request through the proxy server.

Description

apply_filters( 'pre_http_send_through_proxy', (null) $null, (string) $uri, (array) $check, (array) $home ); 

Returning false will bypass the proxy; returning true will send the request through the proxy. Returning null bypasses the filter.

Parameters (4)

0. $null (null) => null
Whether to override the request result. Default null.
1. $uri (string)
URL to check.
2. $check (array)
Associative array result of parsing the URI.
3. $home (array)
Associative array result of parsing the site URL.

Usage

To run the hook, copy the example below.
  1. $null = apply_filters( 'pre_http_send_through_proxy', $null, $uri, $check, $home ); 
  2.  
  3. if ( !empty( $null ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the pre_http_send_through_proxy callback 
  2. function filter_pre_http_send_through_proxy( $null, $uri, $check, $home ) { 
  3. // make filter magic happen here... 
  4. return $null
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'pre_http_send_through_proxy', 'filter_pre_http_send_through_proxy', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'pre_http_send_through_proxy', 'filter_pre_http_send_through_proxy', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/class-wp-http-proxy.php  
  1. $result = apply_filters( 'pre_http_send_through_proxy', null, $uri, $check, $home );