function generate_options_css($data = false) { global $zn_framework, $saved_options; /* CLEAR THE FW OPTIONS CACHE */ $saved_options = false; /** Define some vars **/ $uploads = wp_upload_dir(); $css_dir = THEME_BASE . '/css/'; // Shorten code, save 1 call $zn_uploads_dir = trailingslashit($uploads['basedir']); /** Capture CSS output **/ ob_start(); require $css_dir . 'dynamic_css.php'; $css = ob_get_clean(); $css = apply_filters('zn_dynamic_css', $css); $css = zn_minimify($css); /** Write to zn_dynamic.css file **/ file_put_contents($zn_uploads_dir . 'zn_dynamic.css', $css); }
function compile_css($recompile = false) { if (false == get_option('zn_css_compiled') || $recompile) { global $wp_upload_dir; $zn_uploads_path = trailingslashit($wp_upload_dir['basedir']); $css = false; foreach ($this->all_available_elements as $element) { // Check if the style.css file exists if (file_exists($element['path'] . '/style.css')) { $css .= file_get_contents($element['path'] . '/style.css'); } // Check to see if we have an style.php file if (file_exists($element['path'] . '/style.php')) { ob_start(); include $element['path'] . '/style.php'; $css .= ob_get_clean(); } } $css_code = apply_filters('zn_css', zn_minimify($css)); file_put_contents($zn_uploads_path . 'zn_pb_css.css', $css_code); add_option('zn_css_compiled', true); } }