Changeset 16018
- Timestamp:
- 10/27/2010 06:16:52 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r16003 r16018 535 535 class WP_Object_Query { 536 536 537 /** 538 * Query vars, after parsing 539 * 540 * @since 3.1.0 541 * @access public 542 * @var array 543 */ 544 var $query_vars; 545 546 /** 547 * Retrieve query variable. 548 * 549 * @since 3.1.0 550 * @access public 551 * 552 * @param string $query_var Query variable key. 553 * @return mixed 554 */ 555 function get( $query_var ) { 556 if ( isset( $this->query_vars[$query_var] ) ) 557 return $this->query_vars[$query_var]; 558 559 return ''; 560 } 561 562 /** 563 * Set query variable. 564 * 565 * @since 3.1.0 566 * @access public 567 * 568 * @param string $query_var Query variable key. 569 * @param mixed $value Query variable value. 570 */ 571 function set( $query_var, $value ) { 572 $this->query_vars[ $query_var ] = $value; 573 } 574 537 575 /* 538 576 * Populates the $meta_query property -
trunk/wp-includes/comment.php
r15843 r16018 193 193 } 194 194 195 /** 196 * WordPress Comment Query class. 197 * 198 * @since 3.1.0 199 */ 195 200 class WP_Comment_Query extends WP_Object_Query { 196 201 197 function query( $args ) { 202 /** 203 * Execute the query 204 * 205 * @since 3.1.0 206 * 207 * @param string|array $query_vars 208 * @return int|array 209 */ 210 function query( $query_vars ) { 198 211 global $wpdb; 199 212 … … 216 229 ); 217 230 218 $args = wp_parse_args( $args, $defaults ); 219 extract( $args, EXTR_SKIP ); 231 $this->query_vars = wp_parse_args( $query_vars, $defaults ); 232 233 extract( $this->query_vars, EXTR_SKIP ); 220 234 221 235 // $args can be whatever, only use the args defined in defaults to compute the key -
trunk/wp-includes/query.php
r15982 r16018 659 659 */ 660 660 class WP_Query extends WP_Object_Query { 661 662 /** 663 * Query vars set by the user 661 /** 662 * Initial query vars 664 663 * 665 664 * @since 1.5.0 … … 668 667 */ 669 668 var $query; 670 671 /**672 * Query vars, after parsing673 *674 * @since 1.5.0675 * @access public676 * @var array677 */678 var $query_vars = array();679 669 680 670 /** … … 1583 1573 1584 1574 /** 1585 * Retrieve query variable.1586 *1587 * @since 1.5.01588 * @access public1589 *1590 * @param string $query_var Query variable key.1591 * @return mixed1592 */1593 function get($query_var) {1594 if ( isset($this->query_vars[$query_var]) )1595 return $this->query_vars[$query_var];1596 1597 return '';1598 }1599 1600 /**1601 * Set query variable.1602 *1603 * @since 1.5.01604 * @access public1605 *1606 * @param string $query_var Query variable key.1607 * @param mixed $value Query variable value.1608 */1609 function set($query_var, $value) {1610 $this->query_vars[$query_var] = $value;1611 }1612 1613 /**1614 1575 * Retrieve the posts based on query variables. 1615 1576 * -
trunk/wp-includes/user.php
r16009 r16018 375 375 if ( !empty( $query ) ) { 376 376 $this->query_vars = wp_parse_args( $query, array( 377 'role' => '', 'blog_id' => $GLOBALS['blog_id'], 378 'meta_key' => '', 'meta_value' => '', 'meta_compare' => '', 379 'include' => array(), 'exclude' => array(), 377 'blog_id' => $GLOBALS['blog_id'], 378 'role' => '', 379 'meta_key' => '', 380 'meta_value' => '', 381 'meta_compare' => '', 382 'include' => array(), 383 'exclude' => array(), 380 384 'search' => '', 381 'orderby' => 'login', 'order' => 'ASC', 382 'offset' => '', 'number' => '', 'count_total' => true, 385 'orderby' => 'login', 386 'order' => 'ASC', 387 'offset' => '', 'number' => '', 388 'count_total' => true, 383 389 'fields' => 'all', 384 390 ) );
Note: See TracChangeset
for help on using the changeset viewer.