WP_Fatal_Error_Handler::handle
Runs the shutdown handler.
This method is registered via register_shutdown_function().
Метод класса: WP_Fatal_Error_Handler{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_Fatal_Error_Handler = new WP_Fatal_Error_Handler(); $WP_Fatal_Error_Handler->handle();
Заметки
- Global. WP_Locale.
$wp_localeWordPress date and time locale object.
Список изменений
| С версии 5.2.0 | Введена. |
Код WP_Fatal_Error_Handler::handle() WP Fatal Error Handler::handle WP 6.9.4
public function handle() {
if ( defined( 'WP_SANDBOX_SCRAPING' ) && WP_SANDBOX_SCRAPING ) {
return;
}
// Do not trigger the fatal error handler while updates are being installed.
if ( wp_is_maintenance_mode() ) {
return;
}
try {
// Bail if no error found.
$error = $this->detect_error();
if ( ! $error ) {
return;
}
if ( ! isset( $GLOBALS['wp_locale'] ) && function_exists( 'load_default_textdomain' ) ) {
load_default_textdomain();
}
$handled = false;
if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) {
$handled = wp_recovery_mode()->handle_error( $error );
}
// Display the PHP error template if headers not sent.
if ( is_admin() || ! headers_sent() ) {
$this->display_error_template( $error, $handled );
}
} catch ( Exception $e ) {
// Catch exceptions and remain silent.
}
}