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 :)
make user_row() use id instead of email in get_avatar()