A WordPress-centric search engine for devs and theme authors



wp_should_handle_error ›

Sincen/a
Deprecatedn/a
wp_should_handle_error ( $error )
Parameters:
  • (array) $error Error information retrieved from error_get_last().
    Required: Yes
Returns:
  • (bool) Whether WordPress should handle this error.
Defined at:
Codex:

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



Source

function wp_should_handle_error( $error ) {
	if ( ! isset( $error['type'] ) ) {
		return false;
	}

	$error_types_to_handle = array(
		E_ERROR,
		E_PARSE,
		E_USER_ERROR,
		E_COMPILE_ERROR,
		E_RECOVERABLE_ERROR,
	);

	return in_array( $error['type'], $error_types_to_handle, true );
}