AHSC_Comments.php
5 months ago
AHSC_Deferer.php
5 months ago
AHSC_Plugins.php
5 months ago
AHSC_PostType.php
3 days ago
AHSC_Terms.php
3 days ago
AHSC_Themes.php
5 months ago
AHSC_Plugins.php
37 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; |
| 4 | } |
| 5 | \add_action( 'activated_plugin', 'ahsc_purge_on_plugin_actions' , 200, 1 ); |
| 6 | \add_action( 'deactivate_plugin', 'ahsc_purge_on_plugin_actions' , 200, 1 ); |
| 7 | \add_action( 'delete_plugin', 'ahsc_purge_on_plugin_actions' , 200, 1 ); |
| 8 | |
| 9 | /** |
| 10 | * Ahsc_purge_on_plugin_actions |
| 11 | * Purge cache on plugin activation, deativation |
| 12 | * |
| 13 | * @param string $plugin The plugin name/file. |
| 14 | * |
| 15 | * @since 1.2.0 |
| 16 | * |
| 17 | * @return void |
| 18 | */ |
| 19 | function ahsc_purge_on_plugin_actions( $plugin ) { |
| 20 | $cleaner =new \ArubaSPA\HiSpeedCache\Purger\WpPurger(); |
| 21 | $cleaner->setPurger( AHSC_PURGER ); |
| 22 | /** |
| 23 | * If home page cleaning is set, there is no point in going any further, the entire site cache will be cleaned. |
| 24 | */ |
| 25 | |
| 26 | if ( AHSC_CONSTANT['ARUBA_HISPEED_CACHE_OPTIONS']['ahsc_purge_homepage_on_edit'] || |
| 27 | AHSC_CONSTANT['ARUBA_HISPEED_CACHE_OPTIONS']['ahsc_purge_homepage_on_del'] ) { |
| 28 | global $logger; |
| 29 | if(class_exists('\ArubaSPA\HiSpeedCache\Debug\Logger')){ |
| 30 | // Logger. |
| 31 | AHSC_log( 'hook::' . \current_filter() . '::home::' . $plugin, __NAMESPACE__ . '::' . __FUNCTION__, 'debug' ); |
| 32 | // Logger. |
| 33 | } |
| 34 | $cleaner->purgeAll(); |
| 35 | return; |
| 36 | } |
| 37 | } |