Purpose
Redirects in Wonderful Relations allow automated user redirection based on different conditions, such as login/logout events, 404 errors, or permission issues. Unlike traditional WordPress redirects, Wonderful Relations integrates user Groups-based redirections, ensuring that each user type is sent to the correct location dynamically.
For example: • Users logging in can be redirected based on their group. • Users logging out can be redirected to a custom logout page. • 404 errors can be handled by redirecting to a custom fallback page. • Unauthorized access can be intercepted, ensuring users are redirected before accessing restricted areas.
This ensures a seamless user experience by guiding users to relevant areas of the website.
Visual Example
Parameters
URL
The destination where the user should be redirected.
Action
Defines the event that triggers the redirect:
- after_login → Redirect after successful login.
- after_logout → Redirect after logout.
- template_permission → Redirect users when they lack necessary permissions.
Group
Group that is effected by this redirect rule.
Identifier
A unique key used for tracking and debugging.
Description
A short explanation of the redirect’s purpose.
How It Works
The redirect module listens to three Wordpress hooks:
- wp_login – Redirects users immediately after login.
- wp_logout – Redirects users after logout.
- template_redirect – Handles redirects for 404 errors and permission-based redirects.
When the specified action aligns with the user’s group, the system automatically redirects them to the configured URL.
These redirections are particularly useful for seamlessly integrating Wonderful Relations applications with existing WordPress functionalities or external services, ensuring a smooth and dynamic user experience.
Conclusion
Wonderful Relations Redirects provide a flexible, user-group-based redirection system that dynamically routes users based on login/logout events, errors, or permissions. 🚀