Jetpack_Custom_CSS_Enhancements::_wp_post_revision_fields PHP Method

_wp_post_revision_fields() public static method

Shows Preprocessor code in the Revisions screen, and ensures that post_content_filtered is maintained on revisions
public static _wp_post_revision_fields ( array $fields, array $post ) : array
$fields array Post fields pertinent to revisions.
$post array A post array being processed for insertion as a post revision.
return array $fields Modified array to include post_content_filtered.
    public static function _wp_post_revision_fields($fields, $post)
    {
        // If we're passed in a revision, go get the main post instead.
        if ('revision' === $post['post_type']) {
            $main_post_id = wp_is_post_revision($post['ID']);
            $post = get_post($main_post_id, ARRAY_A);
        }
        if ('custom_css' === $post['post_type']) {
            $fields['post_content'] = __('CSS', 'jetpack');
            $fields['post_content_filtered'] = __('Preprocessor', 'jetpack');
        }
        return $fields;
    }