wp_cache_is_enabled()WPSCache 1.0

No Hooks.

Return

null. Nothing (null).

Usage

wp_cache_is_enabled();

wp_cache_is_enabled() code WPSCache 1.12.0

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