We need to check for ID in array to exclude user ID as search_columns are of different
This commit is contained in:
parent
a88caf5b72
commit
5fb5a7ded2
|
@ -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,9 +1992,11 @@ class WC_AJAX {
|
|||
|
||||
if ( ! empty( $customers ) ) {
|
||||
foreach ( $customers as $customer ) {
|
||||
if ( ! in_array( $customer->ID, $exclude ) ) {
|
||||
$found_customers[ $customer->ID ] = $customer->display_name . ' (#' . $customer->ID . ' – ' . sanitize_email( $customer->user_email ) . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wp_send_json( $found_customers );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue