Created
October 24, 2019 11:32
-
-
Save murshed/1a9c6e7b22786d0a54ba31b9e97455af to your computer and use it in GitHub Desktop.
Add this code to theme function.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_login_failed', 'themeum_login_fail' ); | |
function themeum_login_fail( $username ) { | |
$referrer = $_SERVER['HTTP_REFERER']; | |
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { | |
wp_redirect( $referrer . '?login=failed' ); | |
exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment