[wp-trac] [WordPress Trac] #46019: Themes using get_users() appear to change the current user

WordPress Trac noreply at wordpress.org
Thu Jan 17 11:14:50 UTC 2019


#46019: Themes using get_users() appear to change the current user
-------------------------------+------------------------------
 Reporter:  lordmatt           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Users              |     Version:  5.0.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => reporter-feedback
 * severity:  major => normal


Comment:

 Hi and welcome to Trac!

 As far as I can see, neither `get_users()` nor `WP_User_Query` touch the
 `$current_user` global which is used by `wp_get_current_user()` or any
 other related globals, for that matter. Which means there shouldn't be
 such side effects.

 Does this still happen when running code in one of the default themes with
 no plugins active? Can you perhaps share the code you're using?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46019#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list