PluginProbe
SpinupWP / 1.4.2
SpinupWP v1.4.2
trunk 1.0 1.0.1 1.0.2 1.0.3 1.1 1.1.1 1.1.2 1.2 1.3 1.4 1.4.1 1.4.2 1.5 1.5.1 1.6 1.7 1.7.1 1.8.0 1.9.0 1.9.1
spinupwp / src / Compatibility / ElementorPlugin.php

ElementorPlugin.php in SpinupWP 1.4.2, at src/Compatibility/ElementorPlugin.php

41 lines 718 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace DeliciousBrains\SpinupWp\Compatibility;
4
5 use DeliciousBrains\SpinupWp\Cache;
6
7 class ElementorPlugin {
8 /**
9 * @var Cache
10 */
11 protected $cache;
12
13 /**
14 * Compatibility constructor.
15 *
16 * @param Cache $cache
17 */
18 public function __construct( Cache $cache ) {
19 $this->cache = $cache;
20 }
21
22 /**
23 * Init
24 */
25 public function init() {
26 add_action( 'elementor/core/files/clear_cache', array( $this, 'purge_caches' ) );
27 }
28
29 /**
30 * Clear both the object and page caches.
31 */
32 public function purge_caches() {
33 if ( $this->cache->is_object_cache_enabled() ) {
34 $this->cache->purge_object_cache();
35 }
36
37 if ( $this->cache->is_page_cache_enabled() ) {
38 $this->cache->purge_page_cache();
39 }
40 }
41 }