WP_Super_Cache_Rest_Update_Settings::set_cache_compression() protected WPSCache 1.0
{} Это метод класса: WP_Super_Cache_Rest_Update_Settings{}
Хуков нет.
Возвращает
null/Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->set_cache_compression( $value );
- $value(смешанный) (обязательный)
Код WP_Super_Cache_Rest_Update_Settings::set_cache_compression() WP Super Cache Rest Update Settings::set cache compression WPSCache 1.7.1
protected function set_cache_compression( $value ) {
global $cache_compression, $cache_path;
$new_cache_compression = 0;
if ( defined( 'WPSC_DISABLE_COMPRESSION' ) ) {
$cache_compression = 0;
wp_cache_setting( 'cache_compression', $cache_compression );
} else {
if ( 1 == $value ) {
$new_cache_compression = 1;
}
if ( 1 == ini_get( 'zlib.output_compression' ) || "on" == strtolower( ini_get( 'zlib.output_compression' ) ) ) {
return __( "You attempted to enable compression but `zlib.output_compression` is enabled. See #21 in the Troubleshooting section of the readme file.", 'wp-super-cache' );
}
if ( $new_cache_compression != $cache_compression ) {
$cache_compression = $new_cache_compression;
wp_cache_setting( 'cache_compression', $cache_compression );
if ( function_exists( 'prune_super_cache' ) ) {
prune_super_cache( $cache_path, true );
}
delete_option( 'super_cache_meta' );
}
}
return null;
}