diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 2ab88f0983e..713004737bc 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -1983,7 +1983,6 @@ class WC_AJAX { 'fields' => 'all', 'orderby' => 'display_name', 'search' => '*' . $term . '*', - 'exclude' => $exclude, 'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' ) ) ) ); @@ -1993,7 +1992,9 @@ class WC_AJAX { if ( ! empty( $customers ) ) { foreach ( $customers as $customer ) { - $found_customers[ $customer->ID ] = $customer->display_name . ' (#' . $customer->ID . ' – ' . sanitize_email( $customer->user_email ) . ')'; + if ( ! in_array( $customer->ID, $exclude ) ) { + $found_customers[ $customer->ID ] = $customer->display_name . ' (#' . $customer->ID . ' – ' . sanitize_email( $customer->user_email ) . ')'; + } } }