WP_Http_Encoding::should_decode()public staticWP 2.8.0

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 6.4.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;
}