Changeset 14217
- Timestamp:
- 04/24/2010 06:04:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r14160 r14217 2466 2466 } 2467 2467 2468 // If any posts have been excluded specifically, Ignore those that are sticky. 2469 if ( !empty($sticky_posts) && !empty($q['post__not_in']) ) 2470 $sticky_posts = array_diff($sticky_posts, $q['post__not_in']); 2471 2468 2472 // Fetch sticky posts that weren't in the query results 2469 2473 if ( !empty($sticky_posts) ) { … … 2479 2483 $stickies_where = "AND $wpdb->posts.post_type IN ('" . $post_types . "')"; 2480 2484 } 2485 2481 2486 $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" ); 2482 /** @todo Make sure post is published or viewable by the current user */2483 2487 foreach ( $stickies as $sticky_post ) { 2484 if ( 'publish' != $sticky_post->post_status ) 2488 // Ignore sticky posts the current user cannot read or are not published. 2489 if ( !current_user_can('read_post', $sticky_post->ID) || 'publish' != $sticky_post->post_status ) 2485 2490 continue; 2486 2491 array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
Note: See TracChangeset
for help on using the changeset viewer.