WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_REST_Tax_Classes_V1_Controller::prepare_item_for_response() WC 1.0

Prepare a single tax class output for response.

Это метод класса: WC_REST_Tax_Classes_V1_Controller

Хуки из метода
Возвращает

WP_REST_Response. $response Response data.

Использование

$WC_REST_Tax_Classes_V1_Controller = new WC_REST_Tax_Classes_V1_Controller();
$var = $WC_REST_Tax_Classes_V1_Controller->prepare_item_for_response( $tax_class, $request );
$tax_class(массив) (обязательный)
Tax class data.
$request(WP_REST_Request) (обязательный)
Request object.

Код WC REST Tax Classes V1 Controller::prepare item for response: woocommerce/includes/api/v1/class-wc-rest-tax-classes-controller.php WC 3.6.5

<?php
public function prepare_item_for_response( $tax_class, $request ) {
	$data = $tax_class;

	$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
	$data    = $this->add_additional_fields_to_object( $data, $request );
	$data    = $this->filter_response_by_context( $data, $context );

	// Wrap the data in a response object.
	$response = rest_ensure_response( $data );

	$response->add_links( $this->prepare_links() );

	/**
	 * Filter tax object returned from the REST API.
	 *
	 * @param WP_REST_Response $response  The response object.
	 * @param stdClass         $tax_class Tax object used to create response.
	 * @param WP_REST_Request  $request   Request object.
	 */
	return apply_filters( 'woocommerce_rest_prepare_tax', $response, (object) $tax_class, $request );
}