woocommerce_rest_prepare_note filter-hookWC 3.9.0

Filter a note returned from the API.

Allows modification of the note data right before it is returned.


add_filter( 'woocommerce_rest_prepare_note', 'wp_kama_woocommerce_rest_prepare_note_filter', 10, 3 );

 * Function for `woocommerce_rest_prepare_note` filter-hook.
 * @param WP_REST_Response $response The response object.
 * @param array            $data     The original note.
 * @param WP_REST_Request  $request  Request used to generate the response.
 * @return WP_REST_Response
function wp_kama_woocommerce_rest_prepare_note_filter( $response, $data, $request ){

	// filter...
	return $response;
The response object.
The original note.
Request used to generate the response.


Since 3.9.0 Introduced.

Where the hook is called

woocommerce/src/Admin/API/Notes.php 609
return apply_filters( 'woocommerce_rest_prepare_note', $response, $data, $request );

Where the hook is used in WooCommerce

Usage not found.