[wp-trac] [WordPress Trac] #24169: WP_Customize_Manager loads the current user too early

WordPress Trac noreply at wordpress.org
Fri Aug 12 02:45:04 UTC 2016


#24169: WP_Customize_Manager loads the current user too early
-------------------------------------------+------------------------------
 Reporter:  johnjamesjacoby                |       Owner:
     Type:  defect (bug)                   |      Status:  reopened
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Customize                      |     Version:  3.4
 Severity:  major                          |  Resolution:
 Keywords:  needs-patch reporter-feedback  |     Focuses:
-------------------------------------------+------------------------------

Comment (by johnjamesjacoby):

 > I thought that that the resolution was that the user had to be loaded
 early regardless. I'll re-open.

 WordPress shouldn't load the user before plugins & themes have had a
 chance to get their hooks in.

 I wonder if `SHORTINIT` might work here.

 > @johnjamesjacoby does this help at all?

 Different issue, but somewhat related. Basically, the Hookr plugin is
 checking if the current user is logging in or out before BuddyPress has
 had a chance to load and hook itself in.

 [The reason this happens is because functions like `is_user_logged_in()`
 and `current_user_can()` *can* be called at anytime, and WordPress will go
 get the current user data without complaining very much about it. Both
 BuddyPress & bbPress load most of their code early, but relay off of
 `init` and later into `set_current_user`. If `set_current_user` happens
 before `init`, it puts WordPress (and the authenticity of the current
 user's roles & caps) in an unpredictable state.]

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


More information about the wp-trac mailing list