WP_Fatal_Error_Handler::should_handle_error()protectedWP 5.2.0

Determines whether we are dealing with an error that WordPress should handle in order to protect the admin backend against WSODs.

Метод класса: WP_Fatal_Error_Handler{}

Хуки из метода


true|false. Whether WordPress should handle this error.


// protected - в коде основоного (родительского) или дочернего класса
$result = $this->should_handle_error( $error );
$error(массив) (обязательный)
Error information retrieved from error_get_last().

Список изменений

С версии 5.2.0 Введена.

Код WP_Fatal_Error_Handler::should_handle_error() WP 6.5.3

protected function should_handle_error( $error ) {
	$error_types_to_handle = array(

	if ( isset( $error['type'] ) && in_array( $error['type'], $error_types_to_handle, true ) ) {
		return true;

	 * Filters whether a given thrown error should be handled by the fatal error handler.
	 * 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.
	 * @since 5.2.0
	 * @param bool  $should_handle_error Whether the error should be handled by the fatal error handler.
	 * @param array $error               Error information retrieved from `error_get_last()`.
	return (bool) apply_filters( 'wp_should_handle_php_error', false, $error );