public function get_item( $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 ) );
		}

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

		$response = $this->prepare_item_for_response( $revision, $request );
		return rest_ensure_response( $response );
	}
public function get_item( $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 ) );
		}

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

		$response = $this->prepare_item_for_response( $revision, $request );
		return rest_ensure_response( $response );
	}
public function get_item ( $ 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 ) ) ; } $ revision = $ this -> get_post ( $ request [ 'id' ] ) ; if ( ! $ revision || 'revision' !== $ revision -> post_type ) { return new WP_Error ( 'rest_post_invalid_id' , __ ( 'Invalid revision id.' ) , array ( 'status' => 404 ) ) ; } $ response = $ this -> prepare_item_for_response ( $ revision , $ request ) ; return rest_ensure_response ( $ response ) ; }
Get one revision from the collection

@access public

@param WP_REST_Request $request Full data about the request.
@return WP_Error|array
Get one revision from the collection