Replies: 0
Hello, do filters/actions or a method exist [in TML] for the third step in the following scenario?
1. User tries to access specific page, but I have function in theme that
2. redirects them to TML login page.
3. After logging in, user is redirected to the page they tried to initially access.
Here is the code that blocks access to a specific page (if not logged in):
add_action( 'template_redirect', function() {
if ( is_user_logged_in() ) return;
$restricted = array( 85 );
if ( in_array( get_queried_object_id(), $restricted ) ) {
wp_redirect( site_url( '/donate/login' ) );
exit();
}
});
The page /donate/login
has the TML shortcode [theme-my-login show_gravatar="0" show_reg_link="0"]