Example #1
0
function cfcp_child_theme_export()
{
    if (current_user_can('edit_theme_options') && isset($_GET['cf_action']) && $_GET['cf_action'] == 'cfcp_child_theme_export') {
        $settings = cf_colors_get_settings();
        if (!isset($settings['theme'])) {
            wp_die('Sorry, an error occured.');
        }
        header('Cache-Control: public');
        header('Content-Description: File Transfer');
        header('Content-Disposition: attachment; filename=style.css');
        header('Content-Type: application/zip');
        header('Content-type: text-css');
        echo '/*
Theme Name:     FavePersonal Child Theme (' . $settings['theme']['title'] . ')
Description:    Child theme for FavePersonal (based on <a href="' . $settings['theme']['link'] . '">' . $settings['theme']['title'] . '</a> by ' . $settings['theme']['author'] . ')
Author:         ' . get_bloginfo('name') . '
Author URI:     ' . home_url() . '
Template:       favepersonal
Version:        1.0
*/

/* Add your custom CSS styles here */




/* Your selected colors are below */
';
        echo cfcp_color_css() . "\n\n";
        die;
    }
}
Example #2
0
function cfcp_color_css_min()
{
    $css = cfcp_color_css();
    $css = str_replace(array("\t", "\n", "\r"), '', $css);
    $css = preg_replace('/\\/\\*(.*?)\\*\\//', '', $css);
    echo '<style type="text/css" media="screen">' . $css . '</style>' . "\n";
}