How to redirect logged in users to my desired page instead of the WPCargo Dashboard?
Copy and paste following codes on your child theme’s functions.php file. Change the page-slug into you custom login page’s slug.
WPCargo user roles:
- administrator
- wpcargo_employee
- wpcargo_client
- wpcargo_driver
- cargo_agent
add_filter('login_redirect', 'custom_page'); function custom_page() { /* * Redirect into specific page after specific user role successfuly logged in */ $current_user = wp_get_current_user(); // Ddministrator if( in_array( 'administrator', $current_user->roles ) ){ return home_url( '/custom-page-slug' ); } // WPCargo Client if( in_array( 'wpcargo_client', $current_user->roles ) ){ return home_url( '/custom-page-slug' ); } }