コード例 #1
0
ファイル: core-features.php プロジェクト: ClayMoreBoy/mx
 /**
  * check_timestamp
  *
  * @version 1.0.1
  */
 public static function check_timestamp()
 {
     if (theme_cache::current_user_can('manage_options') && theme_file_timestamp::get_timestamp() < self::get_theme_mtime()) {
         /** clear opcache */
         if (function_exists('opcache_reset')) {
             opcache_reset();
         }
         /** update timestamp */
         theme_file_timestamp::set_timestamp();
     }
 }
コード例 #2
0
 /**
  * process
  */
 public static function process()
 {
     if (!theme_cache::current_user_can('manage_options')) {
         return false;
     }
     @ini_set('max_input_nesting_level', '10000');
     @ini_set('max_execution_time', 0);
     remove_dir(theme_features::get_stylesheet_directory() . theme_features::$basedir_js_min);
     theme_features::minify_force(theme_features::get_stylesheet_directory() . theme_features::$basedir_js_src);
     remove_dir(theme_features::get_stylesheet_directory() . theme_features::$basedir_css_min);
     theme_features::minify_force(theme_features::get_stylesheet_directory() . theme_features::$basedir_css_src);
     theme_features::minify_force(theme_features::get_stylesheet_directory() . theme_features::$basedir_addons);
     theme_file_timestamp::set_timestamp();
     wp_redirect(add_query_arg(__CLASS__, 1, theme_options::get_url()));
     die;
 }
コード例 #3
0
 /**
  * auto_minify
  *
  * @return 
  * @version 2.0.0
  */
 public static function auto_minify()
 {
     /** 
      * js and css files version
      */
     if (theme_cache::current_user_can('manage_options') && theme_file_timestamp::get_timestamp() < self::get_theme_mtime()) {
         ini_set('max_input_nesting_level', 10000);
         ini_set('max_execution_time', 0);
         self::minify_force(self::get_stylesheet_directory() . self::$basedir_js_src);
         self::minify_force(self::get_stylesheet_directory() . self::$basedir_css_src);
         self::minify_force(self::get_stylesheet_directory() . self::$basedir_addons);
         theme_file_timestamp::set_timestamp();
     }
 }