Bootstrap/Load: Ensure recovery link email and related notices are properly translated.

When recovery mode is triggered before the site’s locale has been initialized, the message displayed to the user and the email sent to the site administrator with the recovery mode link are always rendered in `en_US`. This change ensures the site’s locale is used even when an error happens early in the loading process.

Reviewed by swissspidy, SergeyBiryukov, and desrosj.

Props wolly, TimothyBlynJacobs, fierevere.
Fixes #47093.

git-svn-id: https://develop.svn.wordpress.org/trunk@45277 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2019-05-02 10:52:10 +00:00
parent f33df7cde4
commit ff53498be8
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ class WP_Fatal_Error_Handler {
return;
}
if ( ! isset( $GLOBALS['wp_locale'] ) ) {
load_default_textdomain();
}
if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) {
wp_recovery_mode()->handle_error( $error );
}