Make WordPress Core


Ignore:
Timestamp:
04/04/2019 09:23:29 PM (7 years ago)
Author:
desrosj
Message:

Site Health: Ensure the user locale is listed in debug information.

This change switches to using get_user_locale() when adding the language to the Site Health debug information to ensure the user’s locale preference is reflected.

Also, function_exists() checks for switch_to_locale() and restore_previous_locale() were required in the plugin to support older versions of WordPress, but they are not required in core/

Props: Clorith, desrosj.
Fixes #46694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/site-health-info.php

    r45099 r45110  
    6969    $info         = WP_Debug_Data::debug_data();
    7070    $english_info = '';
    71     if ( 0 !== strpos( get_locale(), 'en' ) ) {
     71    if ( 0 !== strpos( get_user_locale(), 'en' ) ) {
    7272        $english_info = WP_Debug_Data::debug_data( 'en_US' );
    7373    }
Note: See TracChangeset for help on using the changeset viewer.