public function load() { if (!class_exists('Jetpack_Custom_CSS') || Jetpack_Custom_CSS::is_preview()) { return; } add_action('init', array('Jetpack_Custom_CSS', 'disable'), 11); add_action('wp_head', array($this, 'embed_css'), 101); }
/** * Override the content_width with a custom value if one is set. */ static function jetpack_content_width($content_width) { $custom_content_width = 0; if (Jetpack_Custom_CSS::is_preview()) { $safecss_post = Jetpack_Custom_CSS::get_current_revision(); $custom_content_width = intval(get_post_meta($safecss_post['ID'], 'content_width', true)); } else { if (!Jetpack_Custom_CSS::is_freetrial()) { $custom_css_post_id = Jetpack_Custom_CSS::post_id(); if ($custom_css_post_id) { $custom_content_width = intval(get_post_meta($custom_css_post_id, 'content_width', true)); } } } if ($custom_content_width > 0) { $content_width = $custom_content_width; } return $content_width; }
static function style_filter($current) { if (Jetpack_Custom_CSS::is_freetrial() && (!Jetpack_Custom_CSS::is_preview() || !current_user_can('switch_themes'))) { return $current; } else { if (Jetpack_Custom_CSS::skip_stylesheet()) { return apply_filters('safecss_style_filter_url', plugins_url('custom-css/blank.css', __FILE__)); } } return $current; }