Redirects wp-login.php access to homepage.
function dr_hide_login_page() {
$request = basename( $_SERVER['REQUEST_URI'] );
if ( $request === 'wp-login.php' && ! is_user_logged_in() ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'init', 'dr_hide_login_page' );