|
@@ 375-385 (lines=11) @@
|
| 372 |
|
$role_queries = array(); |
| 373 |
|
|
| 374 |
|
$roles_clauses = array( 'relation' => 'AND' ); |
| 375 |
|
if ( ! empty( $roles ) ) { |
| 376 |
|
foreach ( $roles as $role ) { |
| 377 |
|
$roles_clauses[] = array( |
| 378 |
|
'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', |
| 379 |
|
'value' => '"' . $role . '"', |
| 380 |
|
'compare' => 'LIKE', |
| 381 |
|
); |
| 382 |
|
} |
| 383 |
|
|
| 384 |
|
$role_queries[] = $roles_clauses; |
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
$role__in_clauses = array( 'relation' => 'OR' ); |
| 388 |
|
if ( ! empty( $role__in ) ) { |
|
@@ 388-398 (lines=11) @@
|
| 385 |
|
} |
| 386 |
|
|
| 387 |
|
$role__in_clauses = array( 'relation' => 'OR' ); |
| 388 |
|
if ( ! empty( $role__in ) ) { |
| 389 |
|
foreach ( $role__in as $role ) { |
| 390 |
|
$role__in_clauses[] = array( |
| 391 |
|
'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', |
| 392 |
|
'value' => '"' . $role . '"', |
| 393 |
|
'compare' => 'LIKE', |
| 394 |
|
); |
| 395 |
|
} |
| 396 |
|
|
| 397 |
|
$role_queries[] = $role__in_clauses; |
| 398 |
|
} |
| 399 |
|
|
| 400 |
|
$role__not_in_clauses = array( 'relation' => 'AND' ); |
| 401 |
|
if ( ! empty( $role__not_in ) ) { |
|
@@ 401-411 (lines=11) @@
|
| 398 |
|
} |
| 399 |
|
|
| 400 |
|
$role__not_in_clauses = array( 'relation' => 'AND' ); |
| 401 |
|
if ( ! empty( $role__not_in ) ) { |
| 402 |
|
foreach ( $role__not_in as $role ) { |
| 403 |
|
$role__not_in_clauses[] = array( |
| 404 |
|
'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', |
| 405 |
|
'value' => '"' . $role . '"', |
| 406 |
|
'compare' => 'NOT LIKE', |
| 407 |
|
); |
| 408 |
|
} |
| 409 |
|
|
| 410 |
|
$role_queries[] = $role__not_in_clauses; |
| 411 |
|
} |
| 412 |
|
|
| 413 |
|
// If there are no specific roles named, make sure the user is a member of the site. |
| 414 |
|
if ( empty( $role_queries ) ) { |