Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I agree, ‘login_redirect’ is the correct filter. There is another way to achieve a redirect without filters though, use javascript or jQuery to set the value of the hidden login form field ‘redirect_to’ to the desired redirect target.

    This will work if ALL ‘login_redirect’ filters are removed, but if any filter is added back, it will overwrite the field value. Even worse, if a plugin hijacks the ‘wp_login’ action and does not return, the ‘login_redirect’ filter will not work, whether filters are removed or not. And the ‘redirect_to’ field trick will not work for the same reason.

    IMO, ‘wp_login’ action was intended to allow plugins to handle added authenticated user management procedures, not to subvert proper login error handling and redirects.

Viewing 1 replies (of 1 total)
  • The topic ‘Correct User Login Redirect Action/Filter’ is closed to new replies.