Changeset 19593 for trunk/wp-includes/query.php
- Timestamp:
- 12/13/2011 11:45:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r19444 r19593 30 30 31 31 /** 32 * Retrieve the currently-queried object. 32 * Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object() 33 33 * 34 34 * @uses WP_Query::get_queried_object … … 729 729 730 730 /* 731 * The Loop. 731 * The Loop. Post loop control. 732 732 */ 733 733 … … 1262 1262 1263 1263 /** 1264 * Whether query vars have changed since the initial parse_query() call. 1264 * Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made 1265 1265 * via pre_get_posts hooks. 1266 1266 * … … 1455 1455 if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']); 1456 1456 1457 // Compat. 1457 // Compat. Map subpost to attachment. 1458 1458 if ( '' != $qv['subpost'] ) 1459 1459 $qv['attachment'] = $qv['subpost']; … … 1478 1478 $this->is_single = false; 1479 1479 } else { 1480 // Look for archive queries. 1480 // Look for archive queries. Dates, categories, authors, search, post type archives. 1481 1481 1482 1482 if ( !empty($qv['s']) ) { … … 2450 2450 if ( !empty($r_status) ) { 2451 2451 if ( !empty($q['perm'] ) && 'editable' == $q['perm'] && !current_user_can($edit_others_cap) ) 2452 $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . 2452 $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $r_status ) . "))"; 2453 2453 else 2454 2454 $statuswheres[] = "(" . join( ' OR ', $r_status ) . ")"; … … 2456 2456 if ( !empty($p_status) ) { 2457 2457 if ( !empty($q['perm'] ) && 'readable' == $q['perm'] && !current_user_can($read_private_cap) ) 2458 $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . 2458 $statuswheres[] = "($wpdb->posts.post_author = $user_ID " . "AND (" . join( ' OR ', $p_status ) . "))"; 2459 2459 else 2460 2460 $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; … … 2565 2565 $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' ); 2566 2566 2567 // Apply post-paging filters on where and join. 2567 // Apply post-paging filters on where and join. Only plugins that 2568 2568 // manipulate paging queries should use these hooks. 2569 2569 if ( !$q['suppress_filters'] ) { … … 2582 2582 } 2583 2583 2584 // Announce current selection parameters. 2584 // Announce current selection parameters. For use by caching plugins. 2585 2585 do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join ); 2586 2586 2587 // Filter again for the benefit of caching plugins. 2587 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2588 2588 if ( !$q['suppress_filters'] ) { 2589 2589 $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) ); … … 2632 2632 $this->posts = $wpdb->get_results($this->request); 2633 2633 2634 // Raw results filter. 2634 // Raw results filter. Prior to status checks. 2635 2635 if ( !$q['suppress_filters'] ) 2636 2636 $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) ); … … 2701 2701 // Move to front, after other stickies 2702 2702 array_splice($this->posts, $sticky_offset, 0, array($sticky_post)); 2703 // Increment the sticky offset. 2703 // Increment the sticky offset. The next sticky will be placed at this offset. 2704 2704 $sticky_offset++; 2705 2705 // Remove post from sticky posts array
Note: See TracChangeset
for help on using the changeset viewer.