Comments 1Ivan started the conversationNovember 22, 2023 at 12:28amHi, I wonder if that is possible to redirect Amelia roles users if they login through WordPress login form to respective Amelia dashboards in the way like this? How Amelia roles predefined in the code? function role_based_redirect() { if ( is_user_logged_in() ) { $user = wp_get_current_user(); $roles = ( array ) $user->roles; if ( in_array( 'amelia_manager', $roles ) ) { wp_redirect( '/wp-admin/admin.php?page=wpamelia-dashboard#/dashboard' ); exit; } elseif ( in_array( 'amelia_employee', $roles ) ) { wp_redirect( '/employee-dashboard/' ); exit; } } elseif ( in_array( 'amelia_customer', $roles ) ) { wp_redirect( '/client-dashboard/' ); exit; } // Add more conditions for other roles and URLs as needed // Add more conditions for other roles and URLs as needed } } add_action( 'template_redirect', 'role_based_redirect' ); 1,574Uroš repliedNovember 23, 2023 at 2:17pmHello Ivan,Thank you for reaching out to us.I will have this forwarded to our developers and will provide you with an update on it as soon as possible.I appreciate your patience. Kind Regards, Uros Jovanovic[email protected] Rate my supportTry our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/ wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community You can try wpDataTables add-ons before purchasing on these sandbox sites: Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables 1,574Uroš repliedNovember 23, 2023 at 6:35pmHello Ivan,Thank you for your patience.The roles are: wpamelia-manager wpamelia-provider wpamelia-customer You can test it, perhaps with some modifications, like: wp_redirect(admin_url('/employee-dashboard/')); Also, the 'template_redirect' action is primarily used for front-end redirections. You might want to try using 'admin_init' instead.Kind Regards, Uros Jovanovic[email protected] Rate my supportTry our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/ wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community You can try wpDataTables add-ons before purchasing on these sandbox sites: Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables 1Ivan repliedNovember 24, 2023 at 8:55amThanks a lot.I will test that out. 1,574Uroš repliedNovember 24, 2023 at 9:39amHello Ivan,That is fine, I am looking forward to your update on this.Please let me know if you have any other questions.Kind Regards, Uros Jovanovic[email protected] Rate my supportTry our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/ wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community You can try wpDataTables add-ons before purchasing on these sandbox sites: Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables Sign in to reply ...
Hi, I wonder if that is possible to redirect Amelia roles users if they login through WordPress login form to respective Amelia dashboards in the way like this? How Amelia roles predefined in the code?
function role_based_redirect() {
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
$roles = ( array ) $user->roles;
if ( in_array( 'amelia_manager', $roles ) ) {
wp_redirect( '/wp-admin/admin.php?page=wpamelia-dashboard#/dashboard' );
exit;
} elseif ( in_array( 'amelia_employee', $roles ) ) {
wp_redirect( '/employee-dashboard/' );
exit;
}
} elseif ( in_array( 'amelia_customer', $roles ) ) {
wp_redirect( '/client-dashboard/' );
exit;
} // Add more conditions for other roles and URLs as needed
// Add more conditions for other roles and URLs as needed
}
}
add_action( 'template_redirect', 'role_based_redirect' );
Hello Ivan,
Thank you for reaching out to us.
I will have this forwarded to our developers and will provide you with an update on it as soon as possible.
I appreciate your patience.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Ivan,
Thank you for your patience.
The roles are:
You can test it, perhaps with some modifications, like:
wp_redirect(admin_url('/employee-dashboard/'));
Also, the 'template_redirect' action is primarily used for front-end redirections. You might want to try using 'admin_init' instead.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Thanks a lot.
I will test that out.
Hello Ivan,
That is fine, I am looking forward to your update on this.
Please let me know if you have any other questions.
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables