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

WC_REST_Shipping_Zone_Methods_V2_Controller::prepare_item_for_response() public WC 1.0

Prepare the Shipping Zone Method for the REST response.

{} Это метод класса: WC_REST_Shipping_Zone_Methods_V2_Controller{}

Хуков нет.

Возвращает

WP_REST_Response. $response

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

$WC_REST_Shipping_Zone_Methods_V2_Controller = new WC_REST_Shipping_Zone_Methods_V2_Controller();
$WC_REST_Shipping_Zone_Methods_V2_Controller->prepare_item_for_response( $item, $request );
$item(массив) (обязательный)
Shipping Zone Method.
$request(WP_REST_Request) (обязательный)
Request object.

Код WC_REST_Shipping_Zone_Methods_V2_Controller::prepare_item_for_response() WC 4.7.1

<?php
public function prepare_item_for_response( $item, $request ) {
	$method = array(
		'id'                 => $item->instance_id,
		'instance_id'        => $item->instance_id,
		'title'              => $item->instance_settings['title'],
		'order'              => $item->method_order,
		'enabled'            => ( 'yes' === $item->enabled ),
		'method_id'          => $item->id,
		'method_title'       => $item->method_title,
		'method_description' => $item->method_description,
		'settings'           => $this->get_settings( $item ),
	);

	$context = empty( $request['context'] ) ? 'view' : $request['context'];
	$data    = $this->add_additional_fields_to_object( $method, $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( $request['zone_id'], $item->instance_id ) );

	$response = $this->prepare_response_for_collection( $response );

	return $response;
}