Hi @daveporter,
Thanks fo reaching out Members Support Team!
Is issue related to login or logout as I didn’t got where is the issue come from? Please elaborate more about the issue and how to replicate it from my end so I can provide porper help.
Looking forward to hearing back from you.
Regards,
Thanks Omar,
I actually found a solution.
I installed this plugin:
https://ww.wp.xz.cn/plugins/wp-login-and-logout-redirect/
That allows me to add a URL to the login and logout, so members of the site who have to login never end up on their profile page – there is only one user account for members of this site to access!
Dave
I was also looking for a solution to this problem. The Members plugin will display a message to indicate you don’t have permission to access this page if the page is restricted. If they get this message because they are not logged in, I want to give them a link to the login page and then redirect them back to the original page after login. I created the following code snippet to do this:
add_filter('members_post_error_message', 'my_login_redirect', 10, 1);
function my_login_redirect( $error_msg ) {
if (!is_user_logged_in()) {
$current_url = home_url( add_query_arg( [], $GLOBALS['wp']->request ) );
$url = esc_url( wp_login_url( $current_url ) );
return '<div class="members-access-error"><b>Please <a href="' . $url . '">Log in</a> to access this page.</b></div>';
}
return $error_msg;
}
Thanks for sharing @joneiseman!