wp_cache_is_enabled() WPSCache 1.0
No Hooks.
Return
Null. Nothing.
Usage
wp_cache_is_enabled();
Code of wp_cache_is_enabled() wp cache is enabled WPSCache 1.7.1
function wp_cache_is_enabled() {
global $wp_cache_config_file;
if ( get_option( 'gzipcompression' ) ) {
echo '<strong>' . __( 'Warning', 'wp-super-cache' ) . '</strong>: ' . __( 'GZIP compression is enabled in WordPress, wp-cache will be bypassed until you disable gzip compression.', 'wp-super-cache' );
return false;
}
$lines = file( $wp_cache_config_file );
foreach ( $lines as $line ) {
if ( preg_match( '/^\s*\$cache_enabled\s*=\s*true\s*;/', $line ) ) {
return true;
}
}
return false;
}