Key Features:
-
Redirect based on role (administrator, editor, customer, etc.)
-
No plugin required
-
Easy to customize
Steps to Use:
-
Edit the URLs in the code (e.g.,
/shop
,/account
) as per your site structure. -
Paste this snippet into your theme’s
functions.php
file or a site-specific plugin. -
Log out and log in with different roles to test.