WP-Members redirect if member ALREADY logged in
I am using the plugin WP-Members. My WordPress front page is the login page for WP-Members.
In my theme functions.php I have used this WP-Members filter and function to redirect members to the posts page once they have logged in.
add_filter( 'wpmem_login_redirect', 'my_login_redirect' );
function my_login_redirect()
{
// return the url that the login should redirect to
return 'http://example.com/specials/';
}
And this is working as designed. However, when someone returns to the site and is already logged in from a previous session this redirect does not detect their logged in status and redirect them. I assume because the function is not called until someone logs in.
I am experienced with programming but new to working in WordPress. I have not been able to find any information on how to resolve this, although I strongly suspect it is out there. Can anyone help point me in the right direction?
I appreciate everyone’s help and guidance in advance.
Thank you!
Leave an answer