Want create site? Find Free WordPress Themes and plugins.

Adding this snippet to the functions.php or your WordPress theme will allow you to redirect failed login attempts to any location. This code snippet helps to you to redirect failed login attempts to any location that you want.

The Code Snippet:

add_action( 'wp_login_failed', 'my_front_end_login_fail' );
function my_front_end_login_fail( $username ) {
     $referrer = $_SERVER['HTTP_REFERER'];
     if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
          wp_redirect( $referrer . '?login=failed' );
          exit;
     }
}

Now enjoy!..

Did you find apk for android? You can find new Free Android Games and apps.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted by Editorial Staff