WordPress at a glance
функция не описана

WP_Recovery_Mode::handle_error() public WP 5.2.0

Handles a fatal error occurring.

The calling API should immediately die() after calling this function.

It's a method of the class: WP_Recovery_Mode{}

Хуков нет.

Возвращает

true/WP_Error. True if the error was handled and headers have already been sent. Or the request will exit to try and catch multiple errors at once. WP_Error if an error occurred preventing it from being handled.

Использование

$WP_Recovery_Mode = new WP_Recovery_Mode();
$WP_Recovery_Mode->handle_error( $error );
$error(array) (required)
Error details from {@see error_get_last()}

Changelog

Since 5.2.0 Introduced.

Код WP_Recovery_Mode::handle_error() WP 5.5.1

<?php
public function handle_error( array $error ) {

	$extension = $this->get_extension_for_error( $error );

	if ( ! $extension || $this->is_network_plugin( $extension ) ) {
		return new WP_Error( 'invalid_source', __( 'Error not caused by a plugin or theme.' ) );
	}

	if ( ! $this->is_active() ) {
		if ( ! is_protected_endpoint() ) {
			return new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) );
		}

		if ( ! function_exists( 'wp_generate_password' ) ) {
			require_once ABSPATH . WPINC . '/pluggable.php';
		}

		return $this->email_service->maybe_send_recovery_mode_email( $this->get_email_rate_limit(), $error, $extension );
	}

	if ( ! $this->store_error( $error ) ) {
		return new WP_Error( 'storage_error', __( 'Failed to store the error.' ) );
	}

	if ( headers_sent() ) {
		return true;
	}

	$this->redirect_protected();
}