Skip to content
Docs
Get RestroPress

Filter

rpress_is_caching_plugin_active

Updated
On this page

Filters whether a page caching plugin is considered active.

Runs at the end of rpress_is_caching_plugin_active(). The default is true when WP Super Cache, W3 Total Cache or WP Rocket is detected. The result decides whether the 'No Caching on Checkout?' option is shown in the miscellaneous settings and whether a nocache query argument is added to URLs, so return true for any other caching setup that needs it.

Parameters#

ParameterTypeDescription
$cachingboolWhether a known caching plugin is active.

Return value#

bool. True if a caching plugin is active.

Example#

add_filter( 'rpress_is_caching_plugin_active', 'my_detect_litespeed_cache', 10, 1 );
function my_detect_litespeed_cache( $caching ) {
	return $caching || defined( 'LSCWP_V' );
}

Source#

Applied in:

  • includes/plugin-compatibility.php (line 51), in rpress_is_caching_plugin_active()
Was this page helpful?