Copy this and paste this code in functions.php
<?php add_filter('login_redirect', '_catch_login_error', 10, 3); function _catch_login_error($redir1, $redir2, $wperr_user) { if(!is_wp_error($wperr_user) || !$wperr_user->get_error_code()) return $redir1; switch($wperr_user->get_error_code()) { case 'incorrect_password': case 'empty_password': case 'invalid_username': default: wp_redirect(site_url().'/home-page/?error='.$wperr_user->get_error_code()); } return $redir1; } ?>
No comments:
Post a Comment