Jetpack_Custom_CSS_Enhancements::customize_update_custom_css_post_content_args PHP Method

customize_update_custom_css_post_content_args() public static method

Store the original pre-processed CSS in post_content_filtered and then store processed CSS in post_content.
public static customize_update_custom_css_post_content_args ( array $args, string $css, WP_Customize_Custom_CSS_Setting $setting ) : mixed
$args array Content post args.
$css string Original CSS being updated.
$setting WP_Customize_Custom_CSS_Setting Custom CSS Setting.
return mixed
    public static function customize_update_custom_css_post_content_args($args, $css, $setting)
    {
        // Find the current preprocessor.
        $jetpack_custom_css = get_theme_mod('jetpack_custom_css', array());
        if (empty($jetpack_custom_css['preprocessor'])) {
            return $args;
        }
        $preprocessor = $jetpack_custom_css['preprocessor'];
        /** This filter is documented in modules/custom-css/custom-css.php */
        $preprocessors = apply_filters('jetpack_custom_css_preprocessors', array());
        // If it's empty, just return.
        if (empty($preprocessor)) {
            return $args;
        }
        if (isset($preprocessors[$preprocessor])) {
            $args['post_content_filtered'] = $css;
            $args['post_content'] = call_user_func($preprocessors[$preprocessor]['callback'], $css);
        }
        return $args;
    }