On this page
WP_Http_Encoding::should_decode( array|string $headers ): bool
Whether the content be decoded based on the headers.
Parameters
$headersarray|string Required-
All of the available headers.
Return
bool
Source
File: wp-includes/class-wp-http-encoding.php. View all references
public static function should_decode( $headers ) {
if ( is_array( $headers ) ) {
if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) {
return true;
}
} elseif ( is_string( $headers ) ) {
return ( stripos( $headers, 'content-encoding:' ) !== false );
}
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| stripos() wp-includes/class-pop3.php |
Used By
| Used By | Description |
|---|---|
| WP_Http_Streams::request() wp-includes/class-wp-http-streams.php | Send a HTTP request to a URI using PHP Streams. |
| WP_Http_Curl::request() wp-includes/class-wp-http-curl.php | Send a HTTP request to a URI using cURL extension. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_encoding/should_decode