Changeset 27185 for trunk/src/wp-includes/user.php
- Timestamp:
- 02/17/2014 09:40:04 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/user.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r26904 r27185 432 432 */ 433 433 function __construct( $query = null ) { 434 if ( !empty( $query ) ) { 434 if ( ! empty( $query ) ) { 435 $this->prepare_query( $query ); 436 $this->query(); 437 } 438 } 439 440 /** 441 * Prepare the query variables 442 * 443 * @since 3.1.0 444 * 445 * @param string|array $args The query variables 446 */ 447 function prepare_query( $query = array() ) { 448 global $wpdb; 449 450 if ( empty( $this->query_vars ) || ! empty( $query ) ) { 451 $this->query_limit = null; 435 452 $this->query_vars = wp_parse_args( $query, array( 436 453 'blog_id' => $GLOBALS['blog_id'], … … 451 468 'who' => '' 452 469 ) ); 453 454 $this->prepare_query(); 455 $this->query(); 456 } 457 } 458 459 /** 460 * Prepare the query variables 461 * 462 * @since 3.1.0 463 * @access private 464 */ 465 function prepare_query() { 466 global $wpdb; 470 } 467 471 468 472 $qv =& $this->query_vars; … … 650 654 * 651 655 * @since 3.1.0 652 * @access private653 656 */ 654 657 function query() { … … 657 660 $qv =& $this->query_vars; 658 661 662 $query = "SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit"; 663 659 664 if ( is_array( $qv['fields'] ) || 'all' == $qv['fields'] ) { 660 $this->results = $wpdb->get_results( "SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");665 $this->results = $wpdb->get_results( $query ); 661 666 } else { 662 $this->results = $wpdb->get_col( "SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");667 $this->results = $wpdb->get_col( $query ); 663 668 } 664 669
Note: See TracChangeset
for help on using the changeset viewer.