@@ 329-339 (lines=11) @@ | ||
326 | $role_queries = array(); |
|
327 | ||
328 | $roles_clauses = array( 'relation' => 'AND' ); |
|
329 | if ( ! empty( $roles ) ) { |
|
330 | foreach ( $roles as $role ) { |
|
331 | $roles_clauses[] = array( |
|
332 | 'key' => $this->db->get_blog_prefix( $blog_id ) . 'capabilities', |
|
333 | 'value' => '"' . $role . '"', |
|
334 | 'compare' => 'LIKE', |
|
335 | ); |
|
336 | } |
|
337 | ||
338 | $role_queries[] = $roles_clauses; |
|
339 | } |
|
340 | ||
341 | $role__in_clauses = array( 'relation' => 'OR' ); |
|
342 | if ( ! empty( $role__in ) ) { |
|
@@ 342-352 (lines=11) @@ | ||
339 | } |
|
340 | ||
341 | $role__in_clauses = array( 'relation' => 'OR' ); |
|
342 | if ( ! empty( $role__in ) ) { |
|
343 | foreach ( $role__in as $role ) { |
|
344 | $role__in_clauses[] = array( |
|
345 | 'key' => $this->db->get_blog_prefix( $blog_id ) . 'capabilities', |
|
346 | 'value' => '"' . $role . '"', |
|
347 | 'compare' => 'LIKE', |
|
348 | ); |
|
349 | } |
|
350 | ||
351 | $role_queries[] = $role__in_clauses; |
|
352 | } |
|
353 | ||
354 | $role__not_in_clauses = array( 'relation' => 'AND' ); |
|
355 | if ( ! empty( $role__not_in ) ) { |
|
@@ 355-365 (lines=11) @@ | ||
352 | } |
|
353 | ||
354 | $role__not_in_clauses = array( 'relation' => 'AND' ); |
|
355 | if ( ! empty( $role__not_in ) ) { |
|
356 | foreach ( $role__not_in as $role ) { |
|
357 | $role__not_in_clauses[] = array( |
|
358 | 'key' => $this->db->get_blog_prefix( $blog_id ) . 'capabilities', |
|
359 | 'value' => '"' . $role . '"', |
|
360 | 'compare' => 'NOT LIKE', |
|
361 | ); |
|
362 | } |
|
363 | ||
364 | $role_queries[] = $role__not_in_clauses; |
|
365 | } |
|
366 | ||
367 | // If there are no specific roles named, make sure the user is a member of the site. |
|
368 | if ( empty( $role_queries ) ) { |