public function get_items( $request ) {

		$parent = $this->get_post( $request['parent'] );
		if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) {
			return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) );
		}

		$revisions = wp_get_post_revisions( $request['parent'] );

		$response = array();
		foreach ( $revisions as $revision ) {
			$data = $this->prepare_item_for_response( $revision, $request );
			$response[] = $this->prepare_response_for_collection( $data );
		}
		return rest_ensure_response( $response );
	}
public function get_items( $request ) {

		$parent = $this->get_post( $request['parent'] );
		if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) {
			return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) );
		}

		$revisions = wp_get_post_revisions( $request['parent'] );

		$response = array();
		foreach ( $revisions as $revision ) {
			$data = $this->prepare_item_for_response( $revision, $request );
			$response[] = $this->prepare_response_for_collection( $data );
		}
		return rest_ensure_response( $response );
	}
public function get_items ( $ request ) { $ parent = $ this -> get_post ( $ request [ 'parent' ] ) ; if ( ! $ request [ 'parent' ] || ! $ parent || $ this -> parent_post_type !== $ parent -> post_type ) { return new WP_Error ( 'rest_post_invalid_parent' , __ ( 'Invalid post parent id.' ) , array ( 'status' => 404 ) ) ; } $ revisions = wp_get_post_revisions ( $ request [ 'parent' ] ) ; $ response = array ( ) ; foreach ( $ revisions as $ revision ) { $ data = $ this -> prepare_item_for_response ( $ revision , $ request ) ; $ response [ ] = $ this -> prepare_response_for_collection ( $ data ) ; } return rest_ensure_response ( $ response ) ; }
Get a collection of revisions

@access public

@param WP_REST_Request $request Full data about the request.
@return WP_Error|WP_REST_Response
Get a collection of revisions