#2134 closed enhancement (fixed)
consolidating get_userdata() and get_userdatabylogin()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | 2.0 |
Component: | Optimization | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Here is a patch which consolidates logic in the two functions get_userdata() and get_userdatabylogin(). If get_userdatabylogin() does not find the user in the cache, it has get_userdata() do the rest. The number of database queries remains the same in all usage cases.
Attachments (3)
Change History (13)
#6
@
18 years ago
- Keywords needs-testing added
- Owner changed from anonymous to westi
- Status changed from new to assigned
I have refreshed the patch to apply to trunk.
The new patch also no longer changes the prototype of any of the functions in pluggable.php.
#7
follow-up:
↓ 8
@
18 years ago
Only change I would make is to change that SQL query so that it only grabs the ID, not the whole row. See patch.
#8
in reply to:
↑ 7
@
18 years ago
Replying to markjaquith:
Only change I would make is to change that SQL query so that it only grabs the ID, not the whole row. See patch.
Yeah makes sense. When updating the patch I stared at the code in wp-db.php but could work out which function I should be using.
NOTE: I didn't indent the code inside the
if
that I added to get_userdata, so that the diff would be easier to read.