PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-dev3
Elementor Website Builder – more than just a page builder v4.1.0-dev3
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
← All changes | modules/element-cache/module.php +15 -0 4.3.2 → 4.1.0-dev3 View file →
@@ -31,8 +31,10 @@
31 31
32 32 if ( is_admin() ) {
33 33 add_action( 'elementor/admin/after_create_settings/' . Settings::PAGE_ID, [ $this, 'register_admin_fields' ], 100 );
34 34 }
35 +
36 + $this->clear_cache_on_site_changed();
35 37 }
36 38
37 39 public function get_unique_id() {
38 40 $unique_id = get_option( static::OPTION_UNIQUE_ID );
@@ -139,6 +141,19 @@
139 141 'desc' => esc_html__( 'Specify the duration for which data is stored in the cache. Elements caching speeds up loading by serving pre-rendered copies of elements, rather than rendering them fresh each time. This control ensures efficient performance and up-to-date content.', 'elementor' ),
140 142 ],
141 143 ]
142 144 );
145 + }
146 +
147 + private function clear_cache_on_site_changed() {
148 + add_action( 'activated_plugin', [ $this, 'clear_cache' ] );
149 + add_action( 'deactivated_plugin', [ $this, 'clear_cache' ] );
150 + add_action( 'switch_theme', [ $this, 'clear_cache' ] );
151 + add_action( 'upgrader_process_complete', [ $this, 'clear_cache' ] );
152 +
153 + add_action( 'update_option_elementor_element_cache_ttl', [ $this, 'clear_cache' ] );
154 + }
155 +
156 + public function clear_cache() {
157 + Plugin::$instance->files_manager->clear_cache();
143 158 }
144 159 }