Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="loginform-custom" id="loginform-custom" action="http://localhost/wp-login.php" method="post">
- /**
- * Redirect user on invalid log-in attempts
- */
- function login_failed() {
- wp_redirect( home_url('/access-denied') );
- exit;
- }
- add_action( 'wp_login_failed', 'login_failed' );
- function verify_username_password( $user, $username, $password ) {
- if( $username == "" || $password == "" ) {
- wp_redirect( home_url('/access-denied') );
- exit;
- }
- }
- function restrict_admin_with_redirect() {
- if ( ! current_user_can( 'manage_options' ) && ( ! wp_doing_ajax() ) ) {
- wp_redirect( site_url('/404') );
- exit;
- }
- }
- add_action( 'admin_init', 'restrict_admin_with_redirect', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement