GC_Fatal_Error_Handler::display_error_template()

最后更新于:2021-11-27 14:49:07

GC_Fatal_Error_Handler::display_error_template( array$error, true|GC_Error$handled)

Displays the PHP error template and sends the HTTP status code, typically 500.

参数

$error

(array) (Required) Error information retrieved from error_get_last().

$handled

(true|GC_Error) (Required) Whether Recovery Mode handled the fatal error.

源文件

文件: gc-includes/class-gc-fatal-error-handler.php

	protected function display_error_template( $error, $handled ) {
		if ( defined( 'GC_CONTENT_DIR' ) ) {
			// Load custom PHP error template, if present.
			$php_error_pluggable = GC_CONTENT_DIR . '/php-error.php';
			if ( is_readable( $php_error_pluggable ) ) {
				require_once $php_error_pluggable;

				return;
			}
		}

		// Otherwise, display the default error template.
		$this->display_default_error_template( $error, $handled );
	}