woocommerce_rest_prepare_customer filter-hookWC 1.0

Filter customer data returned from the REST API.

Usage

add_filter( 'woocommerce_rest_prepare_customer', 'wp_kama_woocommerce_rest_prepare_customer_filter', 10, 3 );

/**
 * Function for `woocommerce_rest_prepare_customer` filter-hook.
 * 
 * @param WP_REST_Response $response  The response object.
 * @param WP_User          $user_data User object used to create response.
 * @param WP_REST_Request  $request   Request object.
 *
 * @return WP_REST_Response
 */
function wp_kama_woocommerce_rest_prepare_customer_filter( $response, $user_data, $request ){

	// filter...
	return $response;
}
$response(WP_REST_Response)
The response object.
$user_data(WP_User)
User object used to create response.
$request(WP_REST_Request)
Request object.

Where the hook is called

WC_REST_Customers_V2_Controller::prepare_item_for_response()
woocommerce_rest_prepare_customer
WC_REST_Customers_V1_Controller::prepare_item_for_response()
woocommerce_rest_prepare_customer
woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-customers-v2-controller.php 111
return apply_filters( 'woocommerce_rest_prepare_customer', $response, $user_data, $request );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-customers-v1-controller.php 560
return apply_filters( 'woocommerce_rest_prepare_customer', $response, $user_data, $request );

Where the hook is used in WooCommerce

Usage not found.