Esempio n. 1
0
 function pl_flush_draft_caches()
 {
     $caches = array('draft_core_raw', 'draft_core_compiled', 'draft_sections_compiled');
     foreach ($caches as $key) {
         pl_cache_del($key);
     }
     $file = sprintf('%s%s', trailingslashit(pl_get_css_dir('path')), 'editor-draft.css');
     if (is_file($file)) {
         unlink($file);
     }
 }
Esempio n. 2
0
 /**
  * Prune all css files
  */
 static function prune_css_files()
 {
     $folder = trailingslashit(pl_get_css_dir('path'));
     $files = glob($folder . '*.css');
     foreach ($files as $file) {
         unlink($file);
     }
 }
Esempio n. 3
0
 /**
  *
  *  Flush rewrites/cached css
  *
  *  @package PageLines DMS
  *  @since 2.2
  */
 static function flush_version($rules = true)
 {
     $types = array('sections', 'core', 'custom');
     $folder = trailingslashit(pl_get_css_dir('path'));
     if ('1' == pl_setting('alternative_css')) {
         $file = 'compiled-css-core.css';
     } else {
         $file = sprintf('compiled-css-core-%s.css', get_theme_mod('pl_save_version'));
     }
     if (is_file($folder . $file)) {
         @unlink($folder . $file);
     }
     if ('1' == pl_setting('alternative_css')) {
         $file = 'compiled-css-sections.css';
     } else {
         $file = sprintf('compiled-css-sections-%s.css', get_theme_mod('pl_save_version'));
     }
     if (is_file($folder . $file)) {
         @unlink($folder . $file);
     }
     // Attempt to flush super-cache and w3 cache.
     if (function_exists('prune_super_cache')) {
         global $cache_path;
         $GLOBALS["super_cache_enabled"] = 1;
         prune_super_cache($cache_path . 'supercache/', true);
         prune_super_cache($cache_path, true);
     }
     if ($rules) {
         flush_rewrite_rules(true);
     }
     set_theme_mod('pl_save_version', time());
     $types = array('sections', 'core', 'custom');
     foreach ($types as $t) {
         $compiled = get_transient("pagelines_{$t}_css");
         $backup = get_transient("pagelines_{$t}_css_backup");
         if (!is_array($backup) && is_array($compiled) && strpos($compiled[$t], 'PARSE ERROR') === false) {
             set_transient("pagelines_{$t}_css_backup", $compiled, 604800);
         }
         delete_transient("pagelines_{$t}_css");
     }
 }