Changeset 15539 for trunk/wp-includes/user.php
- Timestamp:
- 08/27/2010 12:18:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/user.php
r15491 r15539 435 435 436 436 $role = trim( $qv['role'] ); 437 438 if ( $role || is_multisite() ) { 439 $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id"; 440 $this->query_where .= $wpdb->prepare( " AND $wpdb->usermeta.meta_key = %s", $wpdb->prefix . 'capabilities' ); 441 } 442 437 443 if ( $role ) { 438 $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id"; 439 $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $role . '%'); 440 } elseif ( is_multisite() ) { 441 $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels 442 $this->query_from .= ", $wpdb->usermeta"; 443 $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'"; 444 $this->query_where .= $wpdb->prepare( " AND $wpdb->usermeta.meta_value LIKE %s", '%' . like_escape( $role ) . '%' ); 444 445 } 445 446
Note: See TracChangeset
for help on using the changeset viewer.