I have created a common custom dashboard for my users located at “http://website.com/login/dashboard/”
I’m trying to redirect users to that custom dashboard only if they are NOT admins & if the page IS http://www.website.com/login/wp-admin/
The redirection function I have is:
add_action( 'admin_init', 'redirect_so_15396771' );
function redirect_so_15396771()
{
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
return;
if ( current_page('is_admin()') & !current_user_can('delete_users') ) {
wp_redirect( site_url( '/login/dashboard/' ) );
exit();
}
}