#38578 closed defect (bug) (fixed)
`locale` is not a per-site user-option, but rather a global user attribute
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.7 | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | I18N | Keywords: | has-patch |
| Focuses: | Cc: |
Description
In user-edit.php we're using get_user_option() to get a user's locale. This seems incorrect.
- It's the only user setting doing this in this file.
- User locale's are not per-site (
get_user_option()isn't specific for this, but it's *mostly* implied IMO.) - We already have
$profileuserwhich is aWP_Userobject, so we can rely on the magic getter to gather this meta. - We could also use
get_user_locale(), but sinceuser-edit.phpdoes it's own juggle against the results ofget_available_languages()I thinkget_user_locale()includes unnecessary overhead. _get_additional_user_keys()includeslocaleas a global piece of meta (not as a per-site option) which I think confirms my thoughts.
See: #29783.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Also,
wp_insert_user()sets thelocaleuser meta usingupdate_user_meta(). It's never saved as a per-site user option, so I don't thinkget_user_option()is the correct approach in this instance.The bug here, to be clear, is if there was somehow a
wp_2_localekey inwp_usermeta(maybe from a plugin?) it would be what appears as selected in the dropdown... but when the user is updated, it would update thelocalekey, which is what everything else uses.