wp_php_error_message filter-hookWP 5.2.0

Filters the message that the default PHP error template displays.

Usage

add_filter( 'wp_php_error_message', 'wp_kama_php_error_message_filter', 10, 2 );

/**
 * Function for `wp_php_error_message` filter-hook.
 * 
 * @param string $message HTML error message to display.
 * @param array  $error   Error information retrieved from `error_get_last()`.
 *
 * @return string
 */
function wp_kama_php_error_message_filter( $message, $error ){

	// filter...
	return $message;
}
$message(string)
HTML error message to display.
$error(array)
Error information retrieved from error_get_last().

Changelog

Since 5.2.0 Introduced.

Where the hook is called

WP_Fatal_Error_Handler::display_default_error_template()
wp_php_error_message
wp-includes/class-wp-fatal-error-handler.php 213
$message = apply_filters( 'wp_php_error_message', $message, $error );

Where the hook is used in WordPress

Usage not found.