woocommerce_rest_prepare_order_note filter-hookWC 1.0

Filter order note object returned from the REST API.

Usage

add_filter( 'woocommerce_rest_prepare_order_note', 'wp_kama_woocommerce_rest_prepare_order_note_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_order_note` filter-hook.
 * 
 * @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 WP_REST_Response
 */
function wp_kama_woocommerce_rest_prepare_order_note_filter( $response, $note, $request ){

	// filter...
	return $response;
}
$response(WP_REST_Response)
The response object.
$note(WP_Comment)
Order note object used to create response.
$request(WP_REST_Request)
Request object.

Where the hook is called

WC_REST_Order_Notes_V1_Controller::prepare_item_for_response()
woocommerce_rest_prepare_order_note
WC_REST_Order_Notes_Controller::prepare_item_for_response()
woocommerce_rest_prepare_order_note
WC_REST_Order_Notes_V2_Controller::prepare_item_for_response()
woocommerce_rest_prepare_order_note
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-order-notes-v1-controller.php 362
return apply_filters( 'woocommerce_rest_prepare_order_note', $response, $note, $request );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-order-notes-controller.php 61
return apply_filters( 'woocommerce_rest_prepare_order_note', $response, $note, $request );
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-order-notes-v2-controller.php 114
return apply_filters( 'woocommerce_rest_prepare_order_note', $response, $note, $request );

Where the hook is used in WooCommerce

Usage not found.