WordPress at Your Fingertips
function is not described

WC_Abstract_Order::get_billing_and_current_user_aliases() private WC 1.0

Helper method to get all aliases for current user and provide billing email.

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

No Hooks.

Return

Array. Array of all aliases.

Usage

// private - for code of main (parent) class only
$result = $this->get_billing_and_current_user_aliases( $billing_email );
$billing_email(string) (required)
Billing email provided in form.

Code of WC_Abstract_Order::get_billing_and_current_user_aliases() WC 5.8.0

private function get_billing_and_current_user_aliases( $billing_email ) {
	$emails = array( $billing_email );
	if ( get_current_user_id() ) {
		$emails[] = wp_get_current_user()->user_email;
	}
	$emails              = array_unique(
		array_map( 'strtolower', array_map( 'sanitize_email', $emails ) )
	);
	$customer_data_store = WC_Data_Store::load( 'customer' );
	$user_ids            = $customer_data_store->get_user_ids_for_billing_email( $emails );
	return array_merge( $user_ids, $emails );
}