WordPress at Your Fingertips
function is not described

WP_REST_Revisions_Controller::prepare_excerpt_response() protected WP 4.7.0

Checks the post excerpt and prepare it for single post output.

{} It's a method of the class: WP_REST_Revisions_Controller{}

Hooks from the method

String. Prepared excerpt or empty string.


// protected - for code of main (parent) or child class
$result = $this->prepare_excerpt_response( $excerpt, $post );
$excerpt(string) (required)
The post excerpt.
$post(WP_Post) (required)
Post revision object.


Since 4.7.0 Introduced.

Code of WP_REST_Revisions_Controller::prepare_excerpt_response() WP 5.8

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;