#38535 closed defect (bug) (fixed)
Don't init WP_Locale_Switcher in wp_load_translations_early()
Reported by: | ocean90 | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.7 | Priority: | high |
Severity: | normal | Version: | 4.7 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
See ticket:29783:59.
WP_Locale_Switcher
uses get_locale()
/get_user_locale()
to set the original locale. Both functions can return a fatal error if WordPress isn't fully initialized. [38976] tries to fix this but in a bad way. wp_load_translations_early()
sets the locale based on various factors like WPLANG
or $wp_local_package
. [38976] assumes that it's always en_US
.
I'm not aware of a use case where someone would need to switch locales while the site is crashing. I'm proposing to revert [38976] and [38977] and to remove WP_Locale_Switcher
from wp_load_translations_early()
.
Related: #30049
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
In 39005: