F
F
Fqwd1232021-07-11 22:47:47
PHP
Fqwd123, 2021-07-11 22:47:47

How to redirect back?

I have product pages, and at the bottom there are comments to them, and I need that if the user is not registered, a link to the login page pops up, and that after the user logs in, he is redirected back to the same product page. Please tell me how to make such a redirect?
P.S. I want to note that the usual WordPress redirect after authorization does not suit me, because I do not want to change the general behavior, but only locally on the product pages

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vova, 2021-07-11
@Fqwd123

1. When you click on the link, write down cookies with the address.
2. after logging in, redirect back to the address with cookies.
3. delete cookies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question