WordPress.org

Plugin Directory

Changeset 170085


Ignore:
Timestamp:
11/03/09 20:32:42 (7 years ago)
Author:
turl
Message:

Handle WP Super Cache better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • autoptimize/trunk/classes/autoptimizeCache.php

    r164671 r170085  
    8585         
    8686        //Do we need to clean WP Super Cache's cache files? 
    87         if(function_exists('wp_cache_clean_cache') && file_exists(WP_CONTENT_DIR.'/wp-cache-config.php')) 
     87        if(function_exists('wp_cache_clear_cache')) 
    8888        { 
    89             $cacheconfig = file_get_contents(WP_CONTENT_DIR.'/wp-cache-config.php'); 
    90             preg_match('#^\$file_prefix\s*=\s*(\'|")(.*)\\1;$#Um',$cacheconfig,$matches); 
    91             $prefix = $matches[2]; 
    92             wp_cache_clean_cache($prefix); 
    93             unset($cacheconfig,$prefix); 
     89            //Newer WP-Super-Cache 
     90            //See http://ocaoimh.ie/wp-super-cache-developers/ 
     91            wp_cache_clear_cache(); 
     92        }elseif(file_exists(WP_CONTENT_DIR.'/wp-cache-config.php') && function_exists('prune_super_cache')){ 
     93            //Old WP-Super-Cache 
     94            global $cache_path; 
     95            prune_super_cache($cache_path.'supercache/',true); 
     96            prune_super_cache($cache_path,true); 
    9497        } 
    9598         
Note: See TracChangeset for help on using the changeset viewer.