Opened 18 years ago
Closed 16 years ago
#4170 closed defect (bug) (fixed)
author pages do an uncached user_nicename lookup
Reported by: | andy | Owned by: | westi |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | minor | Version: | 2.1 |
Component: | Optimization | Keywords: | has-patch tested |
Focuses: | Cc: |
Description
This isn't an issue until you have a large users table, but these lookups should be cached. Attaching a patch.
Attachments (3)
Change History (15)
#6
@
17 years ago
Looks ok.
I agree with rob1n that the function name should be changed. Furthermore IMHO the cache name should also reflect that user ids are cached, not nicenames. I'd call it user_id_by_nicename or sth. like that.
#8
@
17 years ago
- Keywords needs-patch added; has-patch 2nd-opinion removed
- Milestone changed from 2.5 to 2.6
- Owner set to westi
Nice chunky patch that could do with some love as it no longer applies.
Pushing to 2.6 with needs-patch but will possibly accept for 2.5 if patch is updated.
#9
@
16 years ago
- Component changed from Administration to Optimization
- Keywords has-patch tested added; needs-patch removed
- Milestone changed from 2.9 to 2.8
new patch does the following, against 2.8/trunk:
- add a get_user_by_nicename() function that caches its results
- sets and flushes the cache where appropriate
- uses the function in WP_Query
Note: See
TracTickets for help on using
tickets.
Shouldn't it be get_user_id_by_nicename()? Since it only returns the ID, as far as I can tell...
To me, get_user_by_nicename() returns an user object with that nicename.