Skip to content

Commit 28f1b00

Browse files
committed
enh: adds Cache Enabler compatibility [ref Codeinwp/optimole-service#1595]
1 parent d3b896d commit 28f1b00

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

inc/compatibilities/cache_enabler.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ public function register() {
2626

2727
add_filter( 'cache_enabler_page_contents_before_store', [ Optml_Main::instance()->manager, 'replace_content' ], PHP_INT_MAX, 1 );
2828

29-
add_action(
30-
'optml_settings_updated',
31-
function () {
32-
do_action( 'cache_enabler_clear_site_cache' );
33-
}
34-
);
29+
add_action( 'optml_settings_updated', [ $this, 'add_clear_cache_action' ] );
30+
add_action( 'optml_clear_cache', [ $this, 'add_clear_cache_action' ] );
31+
}
32+
33+
/**
34+
* Clear cache for Cache Enabler.
35+
*
36+
* @return void
37+
*/
38+
public function add_clear_cache_action() {
39+
do_action( 'cache_enabler_clear_site_cache' );
3540
}
3641

3742
/**

0 commit comments

Comments
 (0)