[wp-hackers] function to show total comments by user
danixland at gmail.com
Sun Jan 16 20:36:10 UTC 2011
On 16/01/2011 21:21, Simon Blackbourn wrote:
>> Now my questions are, have I reinvented the wheel? While I wasn't able to
>> find a function within WordPress that does exactly this, maybe you can point
>> me to something I've missed in my research...
> This should work (replace the 1 with your required user ID):
> $userID = 1;
> echo get_comments( array( 'user_id' => $userID, 'count' => true ) );
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
Thanks for replying,
reading trough the codex for get_comments() there's not a single word
about the 'count' option...
I think your solution also doesn't show the total comments for
unregistered users. I could use 'author_email' instead of 'user_id' but
at this point I don't know how to retrieve the email associated with the
Also trying to use your solution it returned an array, so I suppose the
'count' parameter doesn't work...
Danilo aka danix
More information about the wp-hackers