From: Steve Sutton Date: Fri, 21 Sep 2018 18:19:39 +0000 (-0400) Subject: Cache bust for home page when updating conditions X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=6f758d9fb97338580828d297b5052ee0f57188cb;p=WP-Plugins%2Fglm-member-db-conditions.git Cache bust for home page when updating conditions remove cache files for the home page. --- 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 ); }