PluginProbe ʕ •ᴥ•ʔ
Aruba HiSpeed Cache / 3.0.15
Aruba HiSpeed Cache v3.0.15
3.0.15 3.0.14 3.0.13 1.2.4 1.2.5 1.2.6 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.17 2.0.18 2.0.19 2.0.20 2.0.21 2.0.22 2.0.23 2.0.24 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3
aruba-hispeed-cache / src / Events / AHSC_Themes.php
aruba-hispeed-cache / src / Events Last commit date
AHSC_Comments.php 5 months ago AHSC_Deferer.php 5 months ago AHSC_Plugins.php 5 months ago AHSC_PostType.php 4 days ago AHSC_Terms.php 4 days ago AHSC_Themes.php 5 months ago
AHSC_Themes.php
34 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 \add_action( 'switch_theme', 'ahsc_purge_on_switch_theme' , 200, 3 );
6
7 /**
8 * Fires after the theme is switched.
9 *
10 * @param string $new_name Name of the new theme.
11 * @param WP_Theme $new_theme Instance of the new theme.
12 * @param WP_Theme $old_theme Instance of the old theme.
13 * @return void
14 */
15 function ahsc_purge_on_switch_theme( $new_name, $new_theme, $old_theme ) {
16 $cleaner = new \ArubaSPA\HiSpeedCache\Purger\WpPurger();
17 $cleaner->setPurger( AHSC_PURGER );
18 $previous_name = $old_theme->__get( 'title' );
19 $next_name = $new_theme->__get( 'title' );
20
21 /**
22 * If home page cleaning is set, there is no point in going any further, the entire site cache will be cleaned.
23 */
24
25 if ( AHSC_CONSTANT['ARUBA_HISPEED_CACHE_OPTIONS']['ahsc_purge_homepage_on_edit']||
26 AHSC_CONSTANT['ARUBA_HISPEED_CACHE_OPTIONS']['ahsc_purge_homepage_on_del'] ) {
27 if(class_exists('ArubaSPA\HiSpeedCache\Debug\Logger')) {
28 // Logger.
29 AHSC_log( 'hook::switch_theme::home::' . $previous_name . '_to_' . $next_name, __NAMESPACE__ . '::' . __FUNCTION__, 'debug' );
30 // Logger.
31 }
32 $cleaner->purgeAll();
33 }
34 }