WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Routes

AbstractRoute::prepare_item_for_response() public WC 1.0

Prepare a single item for response.

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

No Hooks.

Return

\WP_REST_Response. $response Response data.

Usage

$AbstractRoute = new AbstractRoute();
$AbstractRoute->prepare_item_for_response( $item, $request );
$item(mixed) (required)
Item to format to schema.
$request(WP_REST_Request) (required)
Request object.

Code of AbstractRoute::prepare_item_for_response() WC 5.8.0

public function prepare_item_for_response( $item, \WP_REST_Request $request ) {
	$response = rest_ensure_response( $this->schema->get_item_response( $item ) );
	$response->add_links( $this->prepare_links( $item, $request ) );

	return $response;
}