My In my woocommerce login form successful login it is redirection to shop page I did,
And after login error it should be same page but it goes /wp-login.php.I got some codes but it is working when I enter wrong username or password but when I put empty user name or password it is going /wp-login.php.
Here is the code
function my_front_end_login_fail( $username,$password ){
$referrer = $_SERVER['HTTP_REFERER'];
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ){
wp_redirect( $referrer . '?login_failed=failed' );
exit;
}
}
Can you help me.
If you want to redirect after login :
redirects for login / logout