wp_should_handle_php_error WordPress Filter Hook

The wp_should_handle_php_error hook is a filter hook that allows you to override whether or not WordPress should handle a specific PHP error. This can be useful if you want to handle the error yourself or if you want to log the error to a custom logging system.

apply_filters( 'wp_should_handle_php_error', bool $should_handle_error, array $error ) #

Filters whether a given thrown error should be handled by the fatal error handler.


Description

This filter is only fired if the error is not already configured to be handled by WordPress core. As such, it exclusively allows adding further rules for which errors should be handled, but not removing existing ones.


Top ↑

Parameters

$should_handle_error

(bool)Whether the error should be handled by the fatal error handler.

$error

(array)Error information retrieved from error_get_last().


Top ↑

Source

File: wp-includes/class-wp-fatal-error-handler.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.