On this page
WP_Http_Encoding::compress( string $raw, int $level = 9, string $supports = null ): string|false
Compress raw string using the deflate format.
Description
Supports the RFC 1951 standard.
Parameters
$rawstring Required-
String to compress.
$levelint Optional-
Compression level, 9 is highest.
Default:
9 $supportsstring Optional-
not used. When implemented it will choose the right compression based on what the server supports.
Default:
null
Return
string|false Compressed string on success, false on failure.
Source
File: wp-includes/class-wp-http-encoding.php. View all references
public static function compress( $raw, $level = 9, $supports = null ) {
return gzdeflate( $raw, $level );
}
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/compress