Pagination fixes. Props garyc40. fixes #16357

git-svn-id: https://develop.svn.wordpress.org/trunk@17361 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-01-25 19:20:20 +00:00
parent fd7c566154
commit e131cde02f
5 changed files with 35 additions and 10 deletions
+4 -4
View File
@@ -542,19 +542,19 @@ class WP_User_Query {
*/
function query() {
global $wpdb;
if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) {
$this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
} else {
$this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
}
if ( $this->query_vars['count_total'] )
$this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
if ( !$this->results )
return;
if ( $this->query_vars['count_total'] )
$this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
if ( 'all_with_meta' == $this->query_vars['fields'] ) {
cache_users( $this->results );