WordPress at Your Fingertips
function is not described

WC_REST_Customers_V1_Controller::get_item() public WC 1.0

Get a single customer.

{} It's a method of the class: WC_REST_Customers_V1_Controller{}

No Hooks.

Return

WP_Error|WP_REST_Response.

Usage

$WC_REST_Customers_V1_Controller = new WC_REST_Customers_V1_Controller();
$WC_REST_Customers_V1_Controller->get_item( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of WC_REST_Customers_V1_Controller::get_item() WC 5.9.0

public function get_item( $request ) {
	$id        = (int) $request['id'];
	$user_data = get_userdata( $id );

	if ( empty( $id ) || empty( $user_data->ID ) ) {
		return new WP_Error( 'woocommerce_rest_invalid_id', __( 'Invalid resource ID.', 'woocommerce' ), array( 'status' => 404 ) );
	}

	$customer = $this->prepare_item_for_response( $user_data, $request );
	$response = rest_ensure_response( $customer );

	return $response;
}