コード例 #1
0
function wp_css_is_expired($filename)
{
    global $wp_css;
    $filename = wp_css_filename($filename);
    if (mktime() - @filemtime(WP_CSS_CACHE_PATH . $filename) >= $wp_css['cache']) {
        return TRUE;
    }
    return FALSE;
}
コード例 #2
0
function wp_css_clean($buffer)
{
    global $wp_css;
    $buffer = wp_css_fix_urls($buffer);
    // $buffer = wp_css_fix_font_face($buffer);
    $files = wp_css_get_css_imports($buffer);
    $buffer = $files['buffer'];
    $buffer = str_replace(array("\r\n", "\r", "\n", "\t"), '', $buffer);
    $array['imports'] = $files['files'];
    $array['file'] = $wp_css['file'];
    if (wp_css_is_directory_writable('cache')) {
        wp_css_create_file(wp_css_filename($wp_css['file']), $buffer);
        wp_css_create_file(wp_css_filename($wp_css['file'], '.txt'), serialize($array));
    }
    return $buffer;
}