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:
parent
3b792886c6
commit
2d9f6514c1
|
@ -123,7 +123,8 @@ function get_profile($field, $user = false) {
|
||||||
function get_usernumposts($userid) {
|
function get_usernumposts($userid) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
$userid = (int) $userid;
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue