Site Health: Include both site and user locales in debug information.

Previously, only the site’s locale was displayed in the Site Health debug information. Moving forward, both the site’s default locale and the user’s locale will be specified.

This change also removes the `@param` tag for `WP_Debug_Data::debug_data()`. This parameter was previously removed in [45156].

Props: mukesh27, ianbelanger, Clorith, desrosj.
Fixes #46803.

git-svn-id: https://develop.svn.wordpress.org/trunk@45166 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2019-04-12 15:48:13 +00:00
parent 26869439ff
commit 4740573142

View File

@ -27,14 +27,12 @@ class WP_Debug_Data {
* @throws ImagickException
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $locale Optional. An ISO formatted language code to provide debug translations in. Default null.
* @return array The debug data for the site.
*/
static function debug_data() {
global $wpdb;
// Save few function calls.
$locale = get_user_locale();
$upload_dir = wp_get_upload_dir();
$permalink_structure = get_option( 'permalink_structure' );
$is_ssl = is_ssl();
@ -64,9 +62,13 @@ class WP_Debug_Data {
'value' => $core_version . $core_update_needed,
'debug' => $core_version,
),
'language' => array(
'label' => __( 'Language' ),
'value' => $locale,
'site_language' => array(
'label' => __( 'Site Language' ),
'value' => get_locale(),
),
'user_language' => array(
'label' => __( 'User Language' ),
'value' => get_user_locale(),
),
'home_url' => array(
'label' => __( 'Home URL' ),