Add a filter to get_usernumposts. Fixes #7786 props Malaiac.

git-svn-id: http://svn.automattic.com/wordpress/trunk@9009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-09-27 21:26:57 +00:00
parent f02bf165e7
commit 99b9a27052
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,8 @@ function get_profile($field, $user = false) {
function get_usernumposts($userid) {
global $wpdb;
$userid = (int) $userid;
return $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post'));
$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND ", $userid) . get_private_posts_cap_sql('post'));
return apply_filters('get_usernumposts', $count, $userid);
}
/**