Yep, you can do this via filters in the plugin: https://github.com/johnbillion/user-switching/blob/0fbdead3deeb7b23f006f2a4e0ddce7f248f4d08/user-switching.php#L263-L289
The filters are the same filters that get applied in WordPress core when a user logs in or logs out.
That’s awesome – thanks 🙂
Jon
Hi John,
We’ve recently moved our website and it’s gone back to redirecting to /wp-admin on user switching.
I can’t remember or figure out what I actually changed before to keep it on the same page, if you could possibly point me in the right direction?
Thanks,
Jon
The filters need to be used inside another plugin, or your theme. You may have forgotten to copy something over to your new site.
Hi John,
Thanks for this 🙂
Having had a look, I’m not sure that’s what I had to do to get it to work last time.
I’m looking for it to stay on the same page that the redirect is done from, if there’s some other way to do that?
Thanks,
Jon