ClassesBigCommerceFormsError Handler

Error_Handler

Handles form error management, including storing and retrieving errors for redirection.

  • Full name: \BigCommerce\Forms\Error_Handler

Constants

ConstantVisibilityTypeValue
PARAMpublicstring’bc-error’

Methods

form_error

Handle form errors by storing them in a transient and redirecting to the error page.

public form_error(\WP_Error $errors, array $submission, string $redirect = ''): void

Parameters:

ParameterTypeDescription
$errors\WP_ErrorThe WP_Error object containing the error details.
$submissionarrayThe form submission data.
$redirectstringThe URL to redirect to after processing the error.

get_errors

Retrieve any errors stored in the transient for the current user.

public get_errors(\WP_Error|null $data): \WP_Error|null

Parameters:

ParameterTypeDescription
$data\WP_Error|nullExisting error data to potentially override.

Return Value:

The error data, or null if no errors exist.



Automatically generated on 2025-01-21