WP_REST_Revisions_Controller::prepare_excerpt_response PHP Method

prepare_excerpt_response() protected method

Checks the post excerpt and prepare it for single post output.
Since: 4.7.0
protected prepare_excerpt_response ( string $excerpt, WP_Post $post ) : string
$excerpt string The post excerpt.
$post WP_Post Post revision object.
return string Prepared excerpt or empty string.
    protected function prepare_excerpt_response($excerpt, $post)
    {
        /** This filter is documented in wp-includes/post-template.php */
        $excerpt = apply_filters('the_excerpt', $excerpt, $post);
        if (empty($excerpt)) {
            return '';
        }
        return $excerpt;
    }