Login::login_error_handler( WP_Error $errors, string $redirect )
Summary
Handle errors from the login form, redirecting back to the front-end login page.
Description
Note that is hooked in on a filter, not an action, since the latter was not available.
Parameters
- $errors
-
(WP_Error) (Required)
- $redirect
-
(string) (Required)
Return
(WP_Error)
Source
File: src/BigCommerce/Accounts/Login.php
public function login_error_handler( $errors, $redirect ) { if ( ! $errors->get_error_code() ) { return $errors; // no errors. why are we here? } $url = wp_login_url( $redirect ); $url = add_query_arg( [ 'bc-message' => urlencode( $errors->get_error_code() ) ], $url ); wp_safe_redirect( esc_url_raw( $url ) ); exit(); }