Please write below code in functions.php
function drop_login_redirect( $redirect_to, $request, $user ) {
return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : site_url();
}
add_filter( 'login_redirect', 'drop_login_redirect', 10, 3 );
No comments:
Post a Comment