Changeset 15579 for trunk/wp-includes/user.php
- Timestamp:
- 09/06/2010 08:09:41 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/user.php
r15574 r15579 464 464 $meta_queries[] = wp_array_slice_assoc( $qv, array( 'meta_key', 'meta_value', 'meta_compare' ) ); 465 465 466 $meta_query_sql = _wp_meta_sql( $meta_queries, 'user_id' , $wpdb->usermeta);466 $meta_query_sql = _wp_meta_sql( $meta_queries, 'user_id' ); 467 467 468 468 if ( !empty( $meta_query_sql ) ) { 469 $this->query_where .= " AND $wpdb->users.ID IN ($meta_query_sql)"; 469 $this->query_from .= " INNER JOIN $wpdb->usermeta ON ($wpdb->users.ID = $wpdb->usermeta.user_id)"; 470 $this->query_where .= $meta_query_sql; 470 471 } 471 472 … … 491 492 global $wpdb; 492 493 493 $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);494 $this->results = $wpdb->get_col("SELECT $wpdb->users.ID" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit); 494 495 495 496 if ( !$this->results ) … … 497 498 498 499 if ( $this->query_vars['count_total'] ) 499 $this->total_users = $wpdb->get_var("SELECT COUNT( DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where);500 $this->total_users = $wpdb->get_var("SELECT COUNT($wpdb->users.ID)" . $this->query_from . $this->query_where); 500 501 501 502 if ( 'all' == $this->query_vars['fields'] ) {
Note: See TracChangeset
for help on using the changeset viewer.