Determine user destination on wp-login.php
I am adding functionality to require users to login to view a website by hooking into the
template_redirect action and sending non-authenticated users to wp-login. This is all working fine.
I would like to add a message to the wp-login screen for these visitors, but I do not want the message to be displayed to backend users who are also logging in through the same page. I’m using the
login_message filter to add the text.
Is there a way, when on the wp-login page to determine if the person is trying to login into the frontend or wp-admin? I’m seeing a
$_REQUEST['redirect_to'] variable, but it can sometimes be empty, especially after repeated login attempts, and is just a string so would be a messy conditional.