How to properly create multiple conditions to redirect users roles to different pages
couple notes! No need to check for login status if you are checking capabilities. A visitor (not logged in) only has the exists capability, nothing more. Also, wp_redirect() should always be followed by exit; in most cases. In your example only the last one was followed by exit;. Otherwise this could create loops. I’ve refactored … Read more