[wp-trac] [WordPress Trac] #38578: `locale` is not a per-site user-option, but rather a global user attribute
WordPress Trac
noreply at wordpress.org
Sun Oct 30 22:02:51 UTC 2016
#38578: `locale` is not a per-site user-option, but rather a global user attribute
-----------------------------+-----------------------
Reporter: johnjamesjacoby | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7
Component: I18N | Version: trunk
Severity: normal | Keywords: has-patch
Focuses: |
-----------------------------+-----------------------
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 `$profileuser` which is a `WP_User` object, so we can
rely on the magic getter to gather this meta.
* We could also use `get_user_locale()`, but since `user-edit.php` does
it's own juggle against the results of `get_available_languages()` I think
`get_user_locale()` includes unnecessary overhead.
* `_get_additional_user_keys()` includes `locale` as a global piece of
meta (not as a per-site option) which I think confirms my thoughts.
See: #29783.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38578>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list