Skip to content

Instantly share code, notes, and snippets.

@nb
Created October 2, 2010 15:24
Show Gist options
  • Save nb/607723 to your computer and use it in GitHub Desktop.
Save nb/607723 to your computer and use it in GitHub Desktop.
<?php
function redirect_on_bad_login( $redirect_to, $redirect_to_from_request, $user ) {
if ( is_wp_error( $user ) && isset( $_POST['wp-submit'] ) ) {
wp_redirect( 'http://dir.bg/' );
exit();
}
return $redirect_to;
}
add_filter( 'login_redirect', 'redirect_on_bad_login', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment