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

WC_REST_Order_Notes_Controller::prepare_item_for_response() WC 1.0

Prepare a single order note output for response.

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

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

WP_REST_Response. $response Response data.

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

$WC_REST_Order_Notes_Controller = new WC_REST_Order_Notes_Controller();
$var = $WC_REST_Order_Notes_Controller->prepare_item_for_response( $note, $request );
$note(WP_Comment) (обязательный)
Order note object.
$request(WP_REST_Request) (обязательный)
Request object.

Код WC REST Order Notes Controller::prepare item for response: woocommerce/packages/woocommerce-rest-api/src/Controllers/Version3/class-wc-rest-order-notes-controller.php WC 3.9.0

<?php
public function prepare_item_for_response( $note, $request ) {
	$data = array(
		'id'               => (int) $note->comment_ID,
		'author'           => __( 'woocommerce', 'woocommerce' ) === $note->comment_author ? 'system' : $note->comment_author,
		'date_created'     => wc_rest_prepare_date_response( $note->comment_date ),
		'date_created_gmt' => wc_rest_prepare_date_response( $note->comment_date_gmt ),
		'note'             => $note->comment_content,
		'customer_note'    => (bool) get_comment_meta( $note->comment_ID, 'is_customer_note', true ),
	);

	$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( $note ) );

	/**
	 * Filter order note object returned from the REST API.
	 *
	 * @param WP_REST_Response $response The response object.
	 * @param WP_Comment       $note     Order note object used to create response.
	 * @param WP_REST_Request  $request  Request object.
	 */
	return apply_filters( 'woocommerce_rest_prepare_order_note', $response, $note, $request );
}