[theme-reviewers] get_gravatar must be used?

Otto otto at ottodestruct.com
Fri Feb 25 18:58:29 UTC 2011


On Fri, Feb 25, 2011 at 12:40 PM, Robert Ambartsumov
<robert6292 at gmail.com> wrote:
> Hey,
> Is get gravatar main wordpress function must be used for avatars or can we
> have our own function for gravatars.
> The reason for that is some small stuff that we can't do with the wordpress
> function.

The get_avatar function must be used, and it must be used correctly.
That is to say, if you are showing the avatar for a comment, then you
should be passing it the whole $comment object and not just the email
of the commenter.

Although ideally, you wouldn't be calling get_avatar for a comment at
all, but just using the wp_list_comments() function to let it handle
it properly.

Also, get_avatar has a filter on it that you can use to modify its
output, so there is nothing you cannot do with get_avatar if you
really want to do so. My SFC and STC plugins use this to make it show
Facebook or Twitter avatars when appropriate.

-Otto


More information about the theme-reviewers mailing list