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:
parent
f02bf165e7
commit
99b9a27052
|
@ -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