Ticket #17582: 17582.diff
File 17582.diff, 1.4 KB (added by , 14 years ago) |
---|
-
wp-includes/user.php
383 383 'search' => '', 384 384 'orderby' => 'login', 385 385 'order' => 'ASC', 386 'offset' => '', 'number' => '', 386 'offset' => '', 387 'number' => '', 387 388 'count_total' => true, 388 389 'fields' => 'all', 390 'distinct' => false, 389 391 'who' => '' 390 392 ) ); 391 393 … … 418 420 $this->query_fields = "$wpdb->users.ID"; 419 421 } 420 422 423 if ( $this->query_vars['distinct'] ) { 424 $this->query_fields = 'DISTINCT ' . $this->query_fields; 425 } 426 427 if ( $this->query_vars['count_total'] ) { 428 $this->query_fields = 'SQL_CALC_FOUND_ROWS ' . $this->query_fields; 429 } 430 421 431 $this->query_from = "FROM $wpdb->users"; 422 432 $this->query_where = "WHERE 1=1"; 423 433 … … 545 555 $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"); 546 556 } 547 557 548 if ( $this->query_vars['count_total'] ) 549 $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where"); 558 if ( $this->query_vars['count_total'] ) { 559 $found_users_query = apply_filters( 'found_users_query', "SELECT FOUND_ROWS()" ); 560 $this->total_users = $wpdb->get_var( $found_users_query ); 561 } 550 562 551 563 if ( !$this->results ) 552 564 return;