Change so only single role can be set in role param

This commit is contained in:
Bryce 2015-02-04 19:31:14 +07:00
parent 0f927acdd3
commit d0e0a6be6b
1 changed files with 2 additions and 16 deletions

View File

@ -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