[wp-trac] [WordPress Trac] #64977: The `core/get-site-info` ability returns wrong locale code in the admin

WordPress Trac noreply at wordpress.org
Thu May 21 06:53:14 UTC 2026


#64977: The `core/get-site-info` ability returns wrong locale code in the admin
-----------------------------------------------+---------------------
 Reporter:  afercia                            |       Owner:  gziolo
     Type:  defect (bug)                       |      Status:  closed
 Priority:  normal                             |   Milestone:  7.1
Component:  Abilities API                      |     Version:  6.9
 Severity:  normal                             |  Resolution:  fixed
 Keywords:  has-patch, has-unit-tests, commit  |     Focuses:
-----------------------------------------------+---------------------

Comment (by gziolo):

 In [changeset:"62396" 62396]:
 {{{
 #!CommitTicketReference repository="" revision="62396"
 Abilities: Return the site locale for the core/get-site-info language
 field

 The `core/get-site-info` ability resolved the `language` field via
 `get_bloginfo( 'language' )`, which runs through `determine_locale()` and
 can return the current user's locale in the admin context. As a site-level
 ability, the `language` field should consistently represent the site
 locale. Use `get_locale()` (with `_` normalized to `-`) instead so the
 value reflects the site locale regardless of the requesting user.

 Props iamadisingh, afercia, audrasjb, yusufmudagal, r1k0, gziolo.
 Fixes #64977.
 }}}

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


More information about the wp-trac mailing list