Ticket #17582: 17582.3.diff
File 17582.3.diff, 1.6 KB (added by , 14 years ago) |
---|
-
wp-includes/user.php
360 360 var $query_where; 361 361 var $query_orderby; 362 362 var $query_limit; 363 var $query_groupby = ''; 363 364 364 365 365 366 /** … … 517 518 $clauses = $meta_query->get_sql( 'user', $wpdb->users, 'ID', $this ); 518 519 $this->query_from .= $clauses['join']; 519 520 $this->query_where .= $clauses['where']; 521 $this->query_groupby = 'group by ID'; 520 522 } 521 523 522 524 if ( !empty( $qv['include'] ) ) { … … 540 542 global $wpdb; 541 543 542 544 if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) { 543 $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_ orderby $this->query_limit");545 $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_groupby $this->query_orderby $this->query_limit"); 544 546 } else { 545 $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_ orderby $this->query_limit");547 $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_groupby $this->query_orderby $this->query_limit"); 546 548 } 547 549 548 550 if ( $this->query_vars['count_total'] ) 549 $this->total_users = $wpdb->get_var("SELECT COUNT( *) $this->query_from $this->query_where");551 $this->total_users = $wpdb->get_var("SELECT COUNT(DISTINCT ID) $this->query_from $this->query_where"); 550 552 551 553 if ( !$this->results ) 552 554 return;