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

git-svn-id: https://develop.svn.wordpress.org/trunk@9009 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-09-27 21:26:57 +00:00
parent 3b792886c6
commit 2d9f6514c1
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);
}
/**