On my site I have restricted content. When a user clicks on a link with restricted content he/she is first redirected to the My account login page. After successful login he/she should be redirected to the content of the link they clicked on before login and not to the default My account page or another pre-defined page. Is this possible with a snippet code or a plugin?
I only found a code and plugin that redirects to a dedicated page or to the previous page.
I used code from this site, but that is with a predefined page like "shop" or else. I tried plugin "Previous Page Redirect for WooCommerce", but that is redirecting to the previous page the user came from. I am looking for a solution where the user is directed to the page he/she wanted to visit after the login.