Redirect after Registration with Auto Login
-
Hello there,
first of all, thank you for that awesome plugin. It was exactly what I needed. Unfortunately I encountered some unexpected behavior.
I placed login and registration on one page via shortcodes. When I trigger an action that requires an user account, I get my Login/Registration page with the correct parameter for redirect_to in the URL. When I now register, I am getting logged in and redirected to the homepage.
I checked the code and stumbled upon this:
functions.php Line 746:
$url = apply_filters('login_redirect',home_url(),tml_get_request_value('redirect_to'), $user);
Why is the home_url passed as second parameter? Is this some kind of feature that I didn’t understand?
When you replace Line 746 in functions.php with this code, it’s working as i would have expected it to work:if (tml_get_request_value('redirect_to') == '') { $url = apply_filters( 'login_redirect', home_url(), tml_get_request_value( 'redirect_to' ), $user ); } else { $url = apply_filters( 'login_redirect', tml_get_request_value( 'redirect_to' ), $user ); }
But I am not sure if this is not breaking something else. I didn’t encountered any bugs, but I didn’t test all the features.
Best Regards
Nils
- The topic ‘Redirect after Registration with Auto Login’ is closed to new replies.