getting the redirect URL for a specific user | Peter's Login Redirect | Forum
Back to the login redirect plugin page
1:55 pm
I'd like to have a link on my blog that returns a user to the page they were originally redirected to when they logged in -- essentially, a home button that changes the link depending on the user. Is there a function that I can pass the current user's username into, and get the redirect URL in return?
Thanks!
Yes, that is what the redirect_to_front_page() function does. You pass it 3 variables, in this order:
$redirect_to: the default redirect link you want if no rules match
$requested_redirect_to: just pass it an empty string; this variable it not used
$user: the current WordPress user object (if you don't already have it, I think it can be fetched with the function wp_get_current_user()