Change so only single role can be set in role param
This commit is contained in:
parent
0f927acdd3
commit
d0e0a6be6b
|
@ -538,23 +538,9 @@ class WC_API_Customers extends WC_API_Resource {
|
||||||
'number' => $users_per_page,
|
'number' => $users_per_page,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Custom Role(s)
|
// Custom Role
|
||||||
if ( ! empty( $args['role'] ) ) {
|
if ( ! empty( $args['role'] ) ) {
|
||||||
if ( is_array( $args['role'] ) ) {
|
$query_args['role'] = $args['role'];
|
||||||
unset( $query_args['role'] );
|
|
||||||
$query_args['meta_query'] = array(
|
|
||||||
'relation' => 'OR',
|
|
||||||
);
|
|
||||||
foreach ( $args['role'] as $role ) {
|
|
||||||
$query_args['meta_query'][] = array(
|
|
||||||
'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities',
|
|
||||||
'value' => $role,
|
|
||||||
'compare' => 'like'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$query_args['role'] = $args['role'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
|
Loading…
Reference in New Issue