WordPress at a glance
function is not described

WC_REST_Settings_V2_Controller::prepare_item_for_response() public WC 3.0.0

Prepare a report sales object for serialization.

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

No Hooks.

Return

WP_REST_Response. $response Response data.

Usage

$WC_REST_Settings_V2_Controller = new WC_REST_Settings_V2_Controller();
$WC_REST_Settings_V2_Controller->prepare_item_for_response( $item, $request );
$item(array) (required)
Group object.
$request(WP_REST_Request) (required)
Request object.

Changelog

Since 3.0.0 Introduced.

Code of WC_REST_Settings_V2_Controller::prepare_item_for_response() WC 5.0.0

<?php
public function prepare_item_for_response( $item, $request ) {
	$context = empty( $request['context'] ) ? 'view' : $request['context'];
	$data    = $this->add_additional_fields_to_object( $item, $request );
	$data    = $this->filter_response_by_context( $data, $context );

	$response = rest_ensure_response( $data );

	$response->add_links( $this->prepare_links( $item['id'] ) );

	return $response;
}