Does anyone know the logic on how to do the following:
I have a login section with a password field only on the index, so the user enter the password and submit. Upon submission, I was hoping if the password entered can match with the passwords of the existing protected pages. Once there’s a single match, the user will be redirected to that password protected page as login successful.
Do u think it’s possible..? I need some hope here, thanks!
This answer assumes you are talking about the regular login page,
/wp-login.php
, and that each user exists as a user in the WordPress database. After reading your question again I’m not so sure that is what you want to do.This is a first attempt, but it is not complete because it asks for your password again on the protected post, and because it does not know when you want to visit
/wp-admin/
or another restricted area.