WP_Http_Encoding::should_decode( array|string $headers ): bool

Whether the content be decoded based on the headers.


Parameters

$headers array|string Required
All of the available headers.

Top ↑

Return

bool


Top ↑

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


Top ↑

Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.