Skip to content

Commit 80a0764

Browse files
authored
Elementor support (#1118)
1 parent dd7dda7 commit 80a0764

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

CacheFlush.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ public function flush_all( $extras = null ) {
223223
static $flushed = false;
224224
if ( ! $flushed ) {
225225
$flushed = true;
226+
227+
if ( Util_Environment::is_elementor() ){
228+
\elementor\Plugin::$instance->files_manager->clear_cache();
229+
}
230+
226231
$this->_executor->flush_all( $extras );
227232
}
228233
}

Util_Environment.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,24 @@ public static function is_litespeed() {
366366
return isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( htmlspecialchars( stripslashes( $_SERVER['SERVER_SOFTWARE'] ) ), 'LiteSpeed' ) !== false; // phpcs:ignore
367367
}
368368

369+
/**
370+
* Check whether Elementor is enabled.
371+
*
372+
* @static
373+
*
374+
* @return bool
375+
*/
376+
public static function is_elementor() {
377+
if ( is_plugin_active( 'Elementor\Plugin' ) ) {
378+
return true;
379+
} elseif ( is_plugin_active( 'elementor/elementor.php' ) ) {
380+
// For backward compatibility with older versions of Elementor.
381+
return true;
382+
} else {
383+
return false;
384+
}
385+
}
386+
369387
/**
370388
* Returns true if server is nginx.
371389
*

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=== W3 Total Cache ===
2-
Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto, vmarko, jacobd91, avonville1, jamesros161
2+
Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto, vmarko, jacobd91, avonville1, jamesros161, elanasparkle
33
Tags: CDN, pagespeed, caching, performance, optimize
44
Requires at least: 5.3
55
Tested up to: 6.8

0 commit comments

Comments
 (0)