Hey Edward, no worries.
This plugin uses the wp_destroy_other_sessions
function that was newly added in WP 4.1 to destroy a current user’s old sessions.
So I think what you are wanting to achieve is beyond the scope of what this plugin does – there is not a place to hook in.
The easiest way to do what you want is to modify s2member so the WP default behavior is used and users are sent to the wp-login.php
page when their session is expired and they attempt to view a page designated for loggin-in users only.
When WP redirects to the login screen there is a query var called reauth=1
in the URL which indicates that the user needs to be reauthenticated, we can assume this also means that WP knows they were previously authenticated but now for some reason they aren’t anymore. So then you can redirect wherever you want if that query var exists.
function my_login_redirect_for_expired_sessions() {
if ( 1 != get_query_var( 'reauth' ) ) {
return;
}
wp_safe_redirect( home_url( '/my-custom-login-screen/' ) );
exit;
}
add_action( 'login_init', 'my_login_redirect_for_expired_sessions' );
The code above is untested, but this is the most support I can provide for this issue ??
Good luck!