I am trying to create a redirect for my authors so that when they login (and access the admin area) they are directed to the posts page instead of the Wordpress dashboard. I found a function that works, but the function only works the first time the users access admin area. Each consecutive time they try and access the admin area, without logging out and back in, they are directed to the dashboard.
Here is my code
/* -------- Set default WP Admin page -------- */
function hide_the_dashboard()
{
remove_menu_page( 'index.php' );
}
add_action( 'admin_menu', 'hide_the_dashboard' );
function your_login_redirect( $redirect_to, $request, $user )
{
return admin_url( 'edit.php?post_type=st_kb' );
}
add_filter( 'login_redirect', 'your_login_redirect', 10, 3 );
I would greatly appreciate any help with this issue!