[wp-trac] [WordPress Trac] #44758: The REST API is not respecting the user's locale properly.

WordPress Trac noreply at wordpress.org
Thu Sep 6 05:23:50 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
-------------------------------------------------+-------------------------
 Reporter:  youknowriad                          |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion has-patch has-unit-      |     Focuses:
  tests dev-feedback                             |
-------------------------------------------------+-------------------------

Comment (by mnelson4):

 🎸 rock on!

 > However, there is a bit of an issue with CPTs. When the locale is
 switched, WordPress fires a change_locale action. Core hooks into this to
 re-register the built in post types and taxonomies which have their labels
 set statically during init.

 I'm not clear on why this is a problem. Is it just inefficient?

 >  Alternately, we could try checking for the _locale wayyy earlier in the
 cycle.... We'd now be loading the current user "early" not just in the
 admin and customizer, but the front-end as well.

 This sounds very likely to break plugins that expect the current user to
 be set at its current time, so should probably be avoided IMO. Although
 having the entire request be in that user's locale wouldn't be horrible,
 (that's probably want they assumed would happen).

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


More information about the wp-trac mailing list