WordPress at a glance
function is not described

WP_Fatal_Error_Handler::display_default_error_template() protected WP 5.2.0

Displays the default PHP error template.

This method is called conditionally if no 'php-error.php' drop-in is available.

It calls wp_die() with a message indicating that the site is experiencing technical difficulties and a login link to the admin backend. The 'wp_php_error_message' and 'wp_php_error_args' filters can be used to modify these parameters.

{} It's a method of the class: WP_Fatal_Error_Handler{}

Return

Null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->display_default_error_template( $error, $handled );
$error(array) (required)
Error information retrieved from error_get_last().
$handled(true/WP_Error) (required)
Whether Recovery Mode handled the fatal error.

Changelog

Since 5.2.0 Introduced.
Since 5.3.0 The $handled parameter was added.

Code of WP_Fatal_Error_Handler::display_default_error_template() WP 5.5.3

<?php
protected function display_default_error_template( $error, $handled ) {
	if ( ! function_exists( '__' ) ) {
		wp_load_translations_early();
	}

	if ( ! function_exists( 'wp_die' ) ) {
		require_once ABSPATH . WPINC . '/functions.php';
	}

	if ( ! class_exists( 'WP_Error' ) ) {
		require_once ABSPATH . WPINC . '/class-wp-error.php';
	}

	if ( true === $handled && wp_is_recovery_mode() ) {
		$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.' );
	} elseif ( is_protected_endpoint() ) {
		$message = __( 'There has been a critical error on your website. Please check your site admin email inbox for instructions.' );
	} else {
		$message = __( 'There has been a critical error on your website.' );
	}

	$message = sprintf(
		'<p>%s</p><p><a href="%s">%s</a></p>',
		$message,
		/* translators: Documentation explaining debugging in WordPress. */
		__( 'https://wordpress.org/support/article/debugging-in-wordpress/' ),
		__( 'Learn more about debugging in WordPress.' )
	);

	$args = array(
		'response' => 500,
		'exit'     => false,
	);

	/**
	 * Filters the message that the default PHP error template displays.
	 *
	 * @since 5.2.0
	 *
	 * @param string $message HTML error message to display.
	 * @param array  $error   Error information retrieved from `error_get_last()`.
	 */
	$message = apply_filters( 'wp_php_error_message', $message, $error );

	/**
	 * Filters the arguments passed to {@see wp_die()} for the default PHP error template.
	 *
	 * @since 5.2.0
	 *
	 * @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a
	 *                    'response' key, and optionally 'link_url' and 'link_text' keys.
	 * @param array $error Error information retrieved from `error_get_last()`.
	 */
	$args = apply_filters( 'wp_php_error_args', $args, $error );

	$wp_error = new WP_Error(
		'internal_server_error',
		$message,
		array(
			'error' => $error,
		)
	);

	wp_die( $wp_error, '', $args );
}