WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Admin\API

Orders::get_customer_by_id() protected WC 1.0

Get customer data from customer_id.

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

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_customer_by_id( $customer_id );
$customer_id(array) (required)
ID of customer.

Code of Orders::get_customer_by_id() WC 6.1.0

protected function get_customer_by_id( $customer_id ) {
	global $wpdb;

	$customer_lookup_table = $wpdb->prefix . 'wc_customer_lookup';

	$customer = $wpdb->get_row(
		$wpdb->prepare(
			// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
			"SELECT * FROM {$customer_lookup_table} WHERE customer_id = ( %d )",
			$customer_id
		),
		ARRAY_A
	);

	return $customer;
}