# spinupwp/1.3/src/Compatibility/ElementorPlugin.php

SpinupWP, version 1.3. 41 lines.

- Page: https://pluginprobe.com/plugins/spinupwp/1.3/code/src/Compatibility/ElementorPlugin.php
- Raw: https://pluginprobe.com/plugins/spinupwp/1.3/raw/src/Compatibility/ElementorPlugin.php
- Modified: 2021-02-03T16:09:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/spinupwp/1.3/code/src/Compatibility/ElementorPlugin.php#L10-L20`.

```php
<?php

namespace DeliciousBrains\SpinupWp\Compatibility;

use DeliciousBrains\SpinupWp\Cache;

class ElementorPlugin {
	/**
	 * @var Cache
	 */
	protected $cache;

	/**
	 * Compatibility constructor.
	 *
	 * @param Cache $cache
	 */
	public function __construct( Cache $cache ) {
		$this->cache = $cache;
	}

	/**
	 * Init
	 */
	public function init() {
		add_action( 'elementor/core/files/clear_cache', array( $this, 'purge_caches' ) );
	}

	/**
	 * Clear both the object and page caches.
	 */
	public function purge_caches() {
		if ( $this->cache->is_object_cache_enabled() ) {
			$this->cache->purge_object_cache();
		}

		if ( $this->cache->is_page_cache_enabled() ) {
			$this->cache->purge_page_cache();
		}
	}
}
```
