WP_Http_Encoding::should_decode
Whether the content be decoded based on the headers.
Метод класса: WP_Http_Encoding{}
Хуков нет.
Возвращает
true|false.
Использование
$result = WP_Http_Encoding::should_decode( $headers );
- $headers(массив|строка) (обязательный)
- All of the available headers.
Список изменений
| С версии 2.8.0 | Введена. |
Код WP_Http_Encoding::should_decode() WP Http Encoding::should decode WP 6.8.3
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;
}