From 6f758d9fb97338580828d297b5052ee0f57188cb Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 21 Sep 2018 14:19:39 -0400 Subject: [PATCH] Cache bust for home page when updating conditions remove cache files for the home page. --- models/admin/conditions/index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/models/admin/conditions/index.php b/models/admin/conditions/index.php index 05872a8..c40f000 100644 --- a/models/admin/conditions/index.php +++ b/models/admin/conditions/index.php @@ -218,6 +218,18 @@ class GlmMembersAdmin_conditions_index extends GlmDataConditions public function writeHighLoadPage() { + $site_path = get_home_path(); + // Need to look for and remove the home page cache from WPSuper cache + $host_name = $_SERVER['HTTP_HOST']; + + $search = glob( $site_path . "/wp-content/cache/supercache/$host_name/*.php" ); + + if ( $search ) { + foreach ( $search as $cache_file ) { + unlink( $cache_file ); + } + } + // Setup the Smarty Engine $smarty = new smartyTemplateSupport(); $viewPath = GLM_MEMBERS_EVENTS_PLUGIN_PATH . '/views'; @@ -248,7 +260,6 @@ class GlmMembersAdmin_conditions_index extends GlmDataConditions $htmlOutput = $smarty->template->fetch( $viewFile ); // Write the file out - $site_path = get_home_path(); file_put_contents( $site_path . 'HLP.html', $htmlOutput ); } -- 2.17.1