WP_Fatal_Error_Handler::display_error_template( array $error, true|WP_Error $handled )
- Since
- 5.2.0, 5.3.0
- Source
wp-includes/class-wp-fatal-error-handler.php:144
Displays the PHP error template and sends the HTTP status code, typically 500.
Description
A drop-in 'php-error.php' can be used as a custom template. This drop-in should control the HTTP status code and print the HTML markup indicating that a PHP error occurred. Note that this drop-in may potentially be executed very early in the WordPress bootstrap process, so any core functions used that are not part of
wp-includes/load.php should be checked for before being called. If no such drop-in is available, this will call WP_Fatal_Error_Handler::display_default_error_template().Parameters
$errorarray- Error information retrieved from
error_get_last(). $handledtrue|WP_Error- Whether Recovery Mode handled the fatal error.
Uses · 1
- WP_Fatal_Error_Handler::display_default_error_template()Displays the default PHP error template.
Used by · 1
- WP_Fatal_Error_Handler::handle()Runs the shutdown handler.
Source
protected function display_error_template( $error, $handled ) { if ( defined( 'WP_CONTENT_DIR' ) ) { // Load custom PHP error template, if present. $php_error_pluggable = WP_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 ); }History
Introduced in 5.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
The
$handled parameter was added.from the docblock5.2.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/class-wp-fatal-error-handler.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.