[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 05:51:20 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:
-----------------------------------------------+---------------------
Changes (by gziolo):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"62394" 62394]:
{{{
#!CommitTicketReference repository="" revision="62394"
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:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list