Changeset 21995
- Timestamp:
- 09/25/2012 05:01:59 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/user.php
r21911 r21995 313 313 */ 314 314 class WP_User_Query { 315 316 /** 317 * Query vars, after parsing 318 * 319 * @since 3.5.0 320 * @access public 321 * @var array 322 */ 323 var $query_vars = array(); 315 324 316 325 /** … … 382 391 global $wpdb; 383 392 384 $qv = &$this->query_vars;393 $qv =& $this->query_vars; 385 394 386 395 if ( is_array( $qv['fields'] ) ) { … … 397 406 } 398 407 399 if ( $ this->query_vars['count_total'] )408 if ( $qv['count_total'] ) 400 409 $this->query_fields = 'SQL_CALC_FOUND_ROWS ' . $this->query_fields; 401 410 … … 529 538 global $wpdb; 530 539 531 if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) { 540 $qv =& $this->query_vars; 541 542 if ( is_array( $qv['fields'] ) || 'all' == $qv['fields'] ) { 532 543 $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"); 533 544 } else { … … 535 546 } 536 547 537 if ( $ this->query_vars['count_total'] )548 if ( $qv['count_total'] ) 538 549 $this->total_users = $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) ); 539 550 … … 541 552 return; 542 553 543 if ( 'all_with_meta' == $ this->query_vars['fields'] ) {554 if ( 'all_with_meta' == $qv['fields'] ) { 544 555 cache_users( $this->results ); 545 556 546 557 $r = array(); 547 558 foreach ( $this->results as $userid ) 548 $r[ $userid ] = new WP_User( $userid, '', $ this->query_vars['blog_id'] );559 $r[ $userid ] = new WP_User( $userid, '', $qv['blog_id'] ); 549 560 550 561 $this->results = $r; 551 562 } 563 } 564 565 /** 566 * Retrieve query variable. 567 * 568 * @since 3.5.0 569 * @access public 570 * 571 * @param string $query_var Query variable key. 572 * @return mixed 573 */ 574 function get( $query_var ) { 575 if ( isset( $this->query_vars[$query_var] ) ) 576 return $this->query_vars[$query_var]; 577 578 return null; 579 } 580 581 /** 582 * Set query variable. 583 * 584 * @since 3.5.0 585 * @access public 586 * 587 * @param string $query_var Query variable key. 588 * @param mixed $value Query variable value. 589 */ 590 function set( $query_var, $value ) { 591 $this->query_vars[$query_var] = $value; 552 592 } 553 593
Note: See TracChangeset
for help on using the changeset viewer.