The read_post cap cannot be checked for sticky posts because not logged in users don't have any caps. see #11197

git-svn-id: http://svn.automattic.com/wordpress/trunk@14245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-04-26 22:12:28 +00:00
parent ffd9a036cd
commit 702e3358ad
1 changed files with 1 additions and 1 deletions

View File

@ -2486,7 +2486,7 @@ class WP_Query {
$stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" );
foreach ( $stickies as $sticky_post ) {
// Ignore sticky posts the current user cannot read or are not published.
if ( !current_user_can('read_post', $sticky_post->ID) || 'publish' != $sticky_post->post_status )
if ( 'publish' != $sticky_post->post_status )
continue;
array_splice($this->posts, $sticky_offset, 0, array($sticky_post));
$sticky_offset++;