Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8940 closed defect (bug) (fixed)

Use ID instead of email for get_avatar() in user_row() - makes more sense and hurts nothing

Reported by: jeremyclarke Owned by: jeremyclarke
Priority: normal Milestone: 2.8
Component: Plugins Version: 2.8
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

get_avatar() can take either an ID or an email as the first argument and deals with it intelligently.

Right now in the user_row() function, which generates the table of users in wp-admin/users.php, the get_avatar() function is called using the user's email address.

This is causing me problems because for internal caching reasons my rewrite of get_avatar (its in pluggable.php) does checking against user id's for local avatars but just gets gravatars for emails. This saves me from loading user objects by calling get_user_by_email().

In all other parts of the code (specifically in get_avatar() itself) ID's are prioritized over emails. I think it makes sense for user_row() to use ID as well. If you have a more accurate identifier then you might as well use it right?

The attached patch just changes what part of the user object is called and should have no effect at all on anything other than my problem :)

Attachments (1)

user-row-avatar-use-id.diff​ (590 bytes ) - added by jeremyclarke 18 years ago.
make user_row() use id instead of email in get_avatar()

Download all attachments as: .zip

Change History (2)

@jeremyclarke
18 years ago

make user_row() use id instead of email in get_avatar()

#1 @westi
18 years ago

  • Resolution → fixed
  • Status new → closed

(In [10445]) Switch to using the ID when calling get_avatar internally to support caching plugins. Fixes #8940.

Note: See TracTickets for help on using tickets.