You need to make sure that your code is executed before auth_redirect()
is called.
In simple words, you need to hook the whole function using setup_theme
action. It worked in my case.
Related Posts:
- Can I programmatically login a user without a password?
- What is $interim_login?
- Adding extra authentication field in login page
- What exactly is ReAuth?
- Login members using web services
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- Need to execute a cron job
- how to update current logged user username
- Validate Custom Login field
- How to implement Google reCaptcha without installing a plugin?
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Are there ways of logging in that bypass wp-login.php altogether?
- How to display username and password after registration
- Two factor authentication
- How to generate “WP_Error” Object for user login?
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Where is the php file, that does the checks for login information?
- I want login using email not username wordpress front end
- Reloading page with a query string upon login for admins
- WordPress authentication using custom php?
- authenticate user without redirecting
- Multiple issues with Ajax login function due to browsers and cookies
- How to post frontend login form to a different authentication script from wp-login?
- Custom user roles are unable to login
- Using WordPress login for a non word-press website
- Extend Cookie with auth_cookie_expiration not working
- Can we start session from another php site to wordpress blog site?
- Opening protected page with cookie?
- Handle POST request sent from an external site for login?
- External Authentication
- Login and register by API
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- Preventing session timeout
- Check for correct username on custom login form
- ‘Password field is empty’ error when using autofill in Chrome
- How to disable autocomplete on the wp-login.php page
- how to display the wordpress login and register forms on a 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?
- WordPress Login Footer URL
- moving server can not login
- Save last login date in global before change it?
- How to get login data (session) outside WordPress?
- password protect individual pages
- Restrict PDF links
- Can’t access login page after password reset
- Remote REST request to check login status
- How can I test the login for an expired session?
- Rendering of custom walker menu function not working properly
- Force user to login in home page
- Login as a client no dashboard menu?
- Allow access to a page for admins only
- How to edit comment_reply_link
- How do I get WordPress login to ignore the password input if a particular username is used?
- How To Change Wp Register/Login URL Permanently To My Custom Page
- Custom Login iframe doesn’t work
- What would be the best way to implement Magic Link logins in WordPress?
- Can’t login to WordPress without hitting the Remember Me checkbox. Potential SSL implementation bi-product
- Is it possible to designate the login.php as homepage?
- Force login for a subdirectory within wordpress install
- Redirect login page except on reset pass
- Redirect users after failed login attempt?
- How to secure files based on format and word in file name with wp-config or htaccess?
- Redirect to custom variable
- Get the url of custom login page in the registration page
- How to make wp-login.php not accessible
- Single sign on with custom site
- By registering always make uppercase the first letter of the login
- Best option to implement external register/login to WP from self-made API
- WordPress Conditional Login Links
- Secure login on wordpress [closed]
- How can I password protect a WordPress site without requiring users to log in?
- I cannot login and am getting this error message. .
- Can I Get User ID at Login?
- Cannot log into migrated site
- WordPress SSL not working [closed]
- How to force “remember me” users to login again?
- Reset Password Limit not working
- 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?
- Problem in auto login after registration
- Get WordPress logged in username from root domain when WP is installed in a subfolder
- How to invalidate `password reset key` after being used
- Special link for no automatic login (no username and no password)
- Global login to password protected pages
- Disable / Remove Password for Login WordPress
- Making sure two different wordpress website has auto login
- Site login failed due to strange warning
- Improvements to “limit login attempts” plugin
- loging to Admin page not working at all
- Can’t login through wp-login.php on fresh installation
- WordPress Cookies – wp_set_auth_cookie
- Authenticate return value
- Front-end login problem: requires re-authorization when accessing dashboard
- Using wp_login_form passowrd as undefined
- Redirect non-members to about/intro page
- When trying to login if already logged in, form just shakes – error message remains empty
- How to create an alternative login page that does not use any plugins?
- Must Log In to Visit Site [duplicate]