WC_Abstract_Order::get_billing_and_current_user_aliases()
Helper method to get all aliases for current user and provide billing email.
Метод класса: WC_Abstract_Order{}
Хуков нет.
Возвращает
Массив
. Array of all aliases.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_billing_and_current_user_aliases( $billing_email );
- $billing_email(строка) (обязательный)
- Billing email provided in form.
Код WC_Abstract_Order::get_billing_and_current_user_aliases() WC Abstract Order::get billing and current user aliases WC 9.7.1
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 ); }