From b2d3b7efa23cf8a01e5606d16252f217371c89e1 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 12 May 2010 19:39:30 +0000 Subject: [PATCH] Use correct cap check. see #13358. git-svn-id: http://svn.automattic.com/wordpress/trunk@14584 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index f2e66fc4cc..9d657e01be 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1525,7 +1525,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) { $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; if ( 'readable' == $perm && is_user_logged_in() ) { $post_type_object = get_post_type_object($type); - if ( !current_user_can("read_private_{$post_type_object->capability_type}s") ) { + if ( !current_user_can( $post_type_object->read_private_cap ) ) { $cache_key .= '_' . $perm . '_' . $user->ID; $query .= " AND (post_status != 'private' OR ( post_author = '$user->ID' AND post_status = 'private' ))"; }