Opened 13 years ago
Closed 13 years ago
#13785 closed defect (bug) (fixed)
Un-deprecate get_current_user_id
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
There is not a direct, reliable way to access the current user's ID. You either have to get the user object and then the ID property if present, or assume that the $current_user global is populated already (and that's not a reliable assumption).
get_current_user_id
is the perfect solution and existed (imperfectly) in MU. Rather than deprecating it, we should move it to general WP and make it use the WP pluggable user functions.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
(In [15174]) Update get_current_user_id() and move to user.php. Props filosofo. fixes #13785