0

I have a login redirect that works, EXCEPT it doesn't fire on the first login after having validated the new users email address.

Here is the code:

function admin_default_page() {
  if (current_user_can( 'administrator' )) {

  } else {
      return '/profile-edit/';
  }
}
add_filter('login_redirect', 'admin_default_page');

Normally this works great, however not in this case:

  1. create a new user
  2. click set password link in email
  3. set password
  4. login

Logout and then login back in and the redirect works as normal.

Does this not use the standard login hooks? Is there something wrong with my code?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.