Skip to content
Advertisement

WordPress – Logout redirection based on role

I’m trying to determine how I can redirect users upon logout, to a URL defined by their role. Simply put, I want to redirect admins (as well as editors) that logout to a different URL, than subscribers / privileged users.

I’m using the following code to redirect users at logout right now, but this redirects everyone. Any insight as to how I can have a different redirect based on their account role, would be great!

JavaScript

Thanks!

Advertisement

Answer

Im not sure didnt test but you can use user roles with if else statement

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement