[wp-trac] [WordPress Trac] #64977: The `core/get-site-info` ability returns wrong locale code in the admin
WordPress Trac
noreply at wordpress.org
Tue May 5 04:57:10 UTC 2026
#64977: The `core/get-site-info` ability returns wrong locale code in the admin
---------------------------------+---------------------
Reporter: afercia | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.1
Component: Abilities API | Version: 6.9
Severity: normal | Resolution:
Keywords: abilities has-patch | Focuses:
---------------------------------+---------------------
Comment (by r1k0):
== Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11502
=== Environment
- WordPress: 7.1-alpha-62161-src
- PHP: 8.3.30
- Server: nginx/1.29.5
- Database: mysqli (Server: 8.4.8 / Client: mysqlnd 8.3.30)
- Browser: Chrome 147.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None activated
- Plugins:
* Test Reports 1.2.1
=== Steps taken
1. In WP Admin > Settings > General, set the Site Language to a language
other than English, e.g., Italian.
2. In WP Admin > Users > Profile, set the Language to a different language
e.g., French.
3. Used the code provided by the reporter and created a plugin.
{{{#!php
<?php
/**
* Plugin Name: Test Language Locale
* Description: Difference in language locale
* Version: 1.0
*/
add_action( 'wp_footer', 'language_locale' );
add_action( 'admin_footer', 'language_locale' );
function language_locale () {
$ability = wp_get_ability( 'core/get-site-info' );
$result = $ability->execute();
var_dump( $result['language'] );
}
}}}
4. Head over to the footer of the site on the frontend and observe the
returned language before and after the patch.
5. Head over to the admin dashboard, scroll down to the end of the page
and observe the returned language before and after the patch.
2. ✅ Patch is solving the problem
=== Expected result
- The site locale should be returned in the admin dashboard instead of the
user-specific admin locale.
=== Additional Notes
- None
=== Screenshots/Screencast with results
- Before:
[[Image(https://i.ibb.co/bMPDq4Zf/language-locale-before.png)]]
- After:
[[Image(https://i.ibb.co/Xx2NMzTG/language-locale-after.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64977#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list