Changeset 46119
- Timestamp:
- 09/15/2019 01:17:24 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-fatal-error-handler.php
r45311 r46119 42 42 } 43 43 44 $handled = false; 45 44 46 if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) { 45 wp_recovery_mode()->handle_error( $error );47 $handled = wp_recovery_mode()->handle_error( $error ); 46 48 } 47 49 48 50 // Display the PHP error template if headers not sent. 49 51 if ( is_admin() || ! headers_sent() ) { 50 $this->display_error_template( $error );52 $this->display_error_template( $error, $handled ); 51 53 } 52 54 } catch ( Exception $e ) { … … 126 128 * 127 129 * @since 5.2.0 128 * 129 * @param array $error Error information retrieved from `error_get_last()`. 130 */ 131 protected function display_error_template( $error ) { 130 * @since 5.3.0 The `$handled` parameter was added. 131 * 132 * @param array $error Error information retrieved from `error_get_last()`. 133 * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error. 134 */ 135 protected function display_error_template( $error, $handled ) { 132 136 if ( defined( 'WP_CONTENT_DIR' ) ) { 133 137 // Load custom PHP error template, if present. … … 141 145 142 146 // Otherwise, display the default error template. 143 $this->display_default_error_template( $error );147 $this->display_default_error_template( $error, $handled ); 144 148 } 145 149 … … 154 158 * 155 159 * @since 5.2.0 156 * 157 * @param array $error Error information retrieved from `error_get_last()`. 158 */ 159 protected function display_default_error_template( $error ) { 160 * @since 5.3.0 The `$handled` parameter was added. 161 * 162 * @param array $error Error information retrieved from `error_get_last()`. 163 * @param true|WP_Error $handled Whether Recovery Mode handled the fatal error. 164 */ 165 protected function display_default_error_template( $error, $handled ) { 160 166 if ( ! function_exists( '__' ) ) { 161 167 wp_load_translations_early(); … … 170 176 } 171 177 172 if ( is_protected_endpoint() ) { 173 $message = __( 'The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.' ); 178 if ( true === $handled && wp_is_recovery_mode() ) { 179 $message = __( 'There has been a critical error on your website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.' ); 180 } elseif ( is_protected_endpoint() ) { 181 $message = __( 'There has been a critical error on your website. Please check your site admin email inbox for instructions.' ); 174 182 } else { 175 $message = __( 'The site is experiencing technical difficulties.' );183 $message = __( 'There has been a critical error on your website.' ); 176 184 } 177 185
Note: See TracChangeset
for help on using the changeset viewer.