/**
  * Flush varnish cache
  */
 function flush_varnish()
 {
     _doing_it_wrong('flush_varnish', 'This function is deprecated. Use w3tc_varnish_flush() instead.', '0.9.3');
     w3tc_varnish_flush();
 }
Exemple #2
0
 /**
  * Flush Super Cache and W3 Total Cache
  * 
  * @return void
  **/
 public static function flush_plugin_caches()
 {
     if (function_exists('prune_super_cache')) {
         global $cache_path;
         prune_super_cache($cache_path . 'supercache/', true);
         prune_super_cache($cache_path, true);
     }
     if (class_exists('W3_Plugin_TotalCache')) {
         if (function_exists('w3_instance')) {
             $w3_plugin_totalcache =& w3_instance('W3_Plugin_TotalCache');
         } elseif (is_callable(array('W3_Plugin_TotalCache', 'instance'))) {
             $w3_plugin_totalcache =& W3_Plugin_TotalCache::instance();
         }
         if (method_exists($w3_plugin_totalcache, 'flush')) {
             $w3_plugin_totalcache->flush();
         } elseif (method_exists($w3_plugin_totalcache, 'flush_all')) {
             $w3_plugin_totalcache->flush_all();
         }
         /* Flush varnish */
         if (function_exists('w3tc_varnish_flush')) {
             w3tc_varnish_flush();
         }
     }
 }