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

WordPress Trac noreply at wordpress.org
Tue Apr 23 21:21:03 UTC 2013


#24169: WP_Customize_Manager loads the current user too early
-----------------------------+-----------------------
 Reporter:  johnjamesjacoby  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  3.6
Component:  Themes           |    Version:  3.4
 Severity:  major            |   Keywords:  has-patch
-----------------------------+-----------------------
 When previewing a theme, neither the locale nor the functions.php of
 either parent/child themes have had the opportunity to load ahead of the
 current user. This causes theme previews to load without translations in
 multisite setups where the user chooses their own language, and also means
 any theme that modifies the current user via actions or filters never has
 the chance to hook in in time.

 The problem is introduced when WP_Customize_Manager prematurely calls
 is_user_logged_in() and current_user_can() before $wp->init() has fired,
 on the 'setup_theme' action.

 From what I can tell, these specific checks can be moved into a new
 method, hooked to init, without any consequence. They are only responsible
 for maybe calling wp_die() where appropriate, meaning any past or
 subsequent actions or execution are irrelevant anyways.

 Patch attached fixes this issue by adding an init() method to the
 WP_Customize_Manager class, and moves the user checks into this method.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24169>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list