wp_php_error_message
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_php_error_message
wp-includes/class-wp-fatal-error-handler.php 220
$message = apply_filters( 'wp_php_error_message', $message, $error );