WC_Customer_Data_Store::get_user_ids_for_billing_email()
Get all user ids who have billing_email set to any of the email passed in array.
Метод класса: WC_Customer_Data_Store{}
Хуков нет.
Возвращает
Массив
.
Использование
$WC_Customer_Data_Store = new WC_Customer_Data_Store(); $WC_Customer_Data_Store->get_user_ids_for_billing_email( $emails );
- $emails(массив) (обязательный)
- List of emails to check against.
Код WC_Customer_Data_Store::get_user_ids_for_billing_email() WC Customer Data Store::get user ids for billing email WC 9.4.2
public function get_user_ids_for_billing_email( $emails ) { $emails = array_unique( array_map( 'strtolower', array_map( 'sanitize_email', $emails ) ) ); $users_query = new WP_User_Query( array( 'fields' => 'ID', 'meta_query' => array( array( 'key' => 'billing_email', 'value' => $emails, 'compare' => 'IN', ), ), ) ); return array_unique( $users_query->get_results() ); }