Add private posts to get_usernumposts() when the current_user_can read_private_posts. Props molecularbear. fixes #3868
git-svn-id: http://svn.automattic.com/wordpress/trunk@5190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7bb92d3873
commit
3f0fa28e19
|
@ -10,7 +10,7 @@ function get_profile($field, $user = false) {
|
|||
function get_usernumposts($userid) {
|
||||
global $wpdb;
|
||||
$userid = (int) $userid;
|
||||
return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' AND post_status = 'publish'");
|
||||
return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' " . get_private_posts_cap_sql());
|
||||
}
|
||||
|
||||
// TODO: xmlrpc only. Maybe move to xmlrpc.php.
|
||||
|
|
Loading…
Reference in New Issue