Advertisement
Guest User

Untitled

a guest
Jan 28th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <form name="loginform-custom" id="loginform-custom" action="http://localhost/wp-login.php" method="post">
  2.  
  3. /**
  4. * Redirect user on invalid log-in attempts
  5. */
  6. function login_failed() {
  7. wp_redirect( home_url('/access-denied') );
  8. exit;
  9. }
  10. add_action( 'wp_login_failed', 'login_failed' );
  11.  
  12. function verify_username_password( $user, $username, $password ) {
  13. if( $username == "" || $password == "" ) {
  14. wp_redirect( home_url('/access-denied') );
  15. exit;
  16. }
  17. }
  18.  
  19. function restrict_admin_with_redirect() {
  20. if ( ! current_user_can( 'manage_options' ) && ( ! wp_doing_ajax() ) ) {
  21. wp_redirect( site_url('/404') );
  22. exit;
  23. }
  24. }
  25. add_action( 'admin_init', 'restrict_admin_with_redirect', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement