I link to WP's login page passing: redirect_to=play
...ttp://www.my.com/wp-login.php/?redirect_to=play">Click here...
I use the value (in this case: play) as a flag, not an actual redirect url, because I intercept the redirect request using:
function my_login_redirect($redirect_to, $requested_redirect_to, $user)
{
var_dump($redirect_to);
var_dump($requested_redirect_to);
var_dump($user);
}
add_filter('login_redirect', 'my_login_redirect', 10, 3);
Expected result: $requested_redirect_to would contain the value: play. However, wp login does not relay the original redirect_to value, in fact no mater what I do, the 2 params $requested_redirect_to and $redirect_to are always empty; only $user contains data.
How do I pass my original redirect_to value all the way through the login process and into the filter: login_redirect?
play
in$redirect_to
. it can be other plugins that change this value with filter. try to change the priority to-10
e.g. – mmm Jan 22 '18 at 22:18var_dump($_REQUEST)
contain them? – janh Jan 23 '18 at 8:31$redirect_to
in your code then the URL is lost. – mmm Jan 23 '18 at 8:44