More intelligent redirects for new registrations and logins
Hey all,
Maybe I'm missing something, but I didn't like how when a new business registers or a guest user attempts to write a review on a listing, the following happens:
User . . .
1) Clicks on the button to create a new listing
2) Is brought to a page where they're asked to login or register. They click either one depending on their status
3) User taken to login or registration page where they login or register
4) *Taken to the HOME PAGE where they have no idea what just happened and don't know if it worked or not. (??)
If this is how it's designed, I don't care for it
Thus, I've brought two files into my child theme and made a simple change so that after step 3 (they register or login), they are brought to either the create a new business listing or a the profile that they were originally on before they attempted to leave a review.
File: form-registration.php
replace
if (!isset($redirect)) $redirect = home_url();
with
if (!isset($redirect)) $redirect = $_SERVER[HTTP_REFERER];
-----------
File: form-login.php
replace
if (!isset($redirect)) $redirect = home_url();
with
if (!isset($redirect)) $redirect = $_SERVER[HTTP_REFERER];
(same for both)
Let me know if I'm completely off base or am missing some core understanding of how this should work, but otherwise i hope it helps some.
kevin