||
means OR.
Your code will never allow $current_user to proceed because one of the OR conditions will fail.
Try using AND &&
instead:
if ( ($current_user->user_login != 'john') && ($current_user->user_login != 'sheila' ) ) {
Related Posts:
- Private page protected with username and password
- Separate registration and login for different roles
- How reduce wordpress login session timeout time?
- Disallow user from editing their own profile information
- add the user name to menu when user is logged in [closed]
- How long do users stay logged in if they DON’T check remember me?
- how to logout user on browser tab or window closes
- Custom Connect to Facebook, problem logging in/logging out
- Preexisting login to change to logout link in sub menu
- Restricting frontend acess based on user role otherwise redirect to login form
- Deny a user role to log in after register
- How to integrate external user tables with WP?
- Allow Users Only Edit Their Profile?
- Logout users upon login, based on caps/role?
- Session Experies and Get Logged Out Within Few Minutes
- WordPress error on log out ‘Not Permitted’ and can’t log out
- Set Default User Role
- Add logout link when logged in, make it disappear when logged out?
- Generate email on meta value update
- How to remove ‘wordpress…’ text from page titles in tabs
- Invalidate username if it contains @ symbol
- WordPress Login redirection according to user role
- Display first name instead of username
- Prevent Subscriber Role to login
- WordPress not logged in locally with correct username and password
- Can I protect a type of content site-wide with a single password?
- Login Based on ip
- URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
- Make WordPress User Name be the Company Name when Registering (not the default ‘first name’ last name’ email address’)
- Custom failed login error messages for users based on user role?
- Problem with is_user_logged_in() function in some pages
- Custom user roles are unable to login
- Why deleting/removing cookies in WordPress does not log me out from admin?
- User login without username, only password
- wp_logout logging everyone out instead of just the user that clicked the logout link!
- Cannot login with correct username and password anymore
- Username character requirements
- Inconsistent login state
- Can i hide a dynamically created div to logged out users?
- SSO / authentication integration with external ‘directory service’
- Preventing session timeout
- Check for correct username on custom login form
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- how to display the wordpress login and register forms on a page?
- How can I add a custom script to footer of login page?
- Is it alright for two people to simultaneously be logged into a WP site as administrator?
- How do I turn off the ability to login?
- Give visitor access to password protected page/post via external script
- WordPress Login Footer URL
- Save last login date in global before change it?
- wordpress custom login successful redirect hook
- How to get login data (session) outside WordPress?
- password protect individual pages
- Change register form action url
- Is back-end access not required for an app to post to my blog?
- Store brute-force IP addresses
- How do I make my site publicly viewable? Everything redirects to wp-admin
- WordPress Security – How to block alternative WordPress access
- Protecting WordPress login page
- reset password link redirect to login page
- Deregister default wp-admin css on login screen only?
- SSO to WP, from a non-wp site on a different domain and server
- How can I login as admin after redirect to custom login page
- Login with serialized password
- is_user_logged_in() not working in Firefox
- Why would the login page reload indefinitely?
- Creating custom login errors
- Enqueue new login style sheet
- WordPress Conditional Login Links
- Do more action after login successfully
- Cannot log into migrated site
- WordPress SSL not working [closed]
- login logout menu changes in wordpress [closed]
- I want login using email not username wordpress front end
- How to Remove default “Login” link
- How to unpublish my new site while working on it?
- Custom page only editable by one user
- How to force “remember me” users to login again?
- User not able to sign in after wp_authenticate() and wp_signon() wordpress
- WordPress site login Redirect
- Thank You Page Layout Differs on User Logged In Status
- On Homepage “is_user_logged_in()” function is not working after login and it is working after refresh the page?
- Cant reset password my wordpress password not even with phpMyAdmin
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- wp-cron event doesn’t run when custom login API is enabled
- Does it make sense to check a nonce on user log in?
- WordPress Auto Login From Email Link
- Building a custom login form – encountering issues
- Site login failed due to strange warning
- Conditional redirect on login using referring URL
- Chosen user password in registration is not being accepted on Login
- WordPress Cookies – wp_set_auth_cookie
- Authenticate return value
- Front-end login problem: requires re-authorization when accessing dashboard
- When trying to login if already logged in, form just shakes – error message remains empty
- Handle POST request sent from an external site for login?
- Unable to login after adding ReCaptacha without API key
- How to create an alternative login page that does not use any plugins?
- issue with my wp site after login
- How to create a fully functional user registration in WordPress?