wp_http_accept_encoding

Filters the allowed encoding types.

Description

apply_filters( 'wp_http_accept_encoding', (array) $type, (string) $url, (array) $args ); 

Parameters (3)

0. $type (array)
Encoding types allowed. Accepts gzinflate,, gzuncompress., gzdecode.
1. $url (string)
URL of the HTTP request.
2. $args (array)
HTTP request arguments.

Usage

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

Defined (1)

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

/wp-includes/class-wp-http-encoding.php  
  1. $type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );