Index: src/wp-admin/css/login.css
===================================================================
--- src/wp-admin/css/login.css	(revision 45714)
+++ src/wp-admin/css/login.css	(working copy)
@@ -131,6 +131,17 @@
 	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
 }
 
+.login-action-confirm_admin_email #login {
+	width: 60vw;
+	margin-top: -2vh;
+}
+
+@media screen and (max-width: 782px) {
+	.login-action-confirm_admin_email #login {
+		width: 100vw;
+	}
+}
+
 .login form .forgetmenot {
 	font-weight: 400;
 	float: left;
@@ -141,6 +152,36 @@
 	float: right;
 }
 
+.login .admin-email-confirm-form .submit {
+	text-align: center;
+}
+
+.admin-email__later {
+	text-align: left;
+}
+
+#login form p.admin-email__details {
+	margin: 1.1em 0;
+}
+
+.login h1.admin-email__heading {
+	border-bottom: 1px rgb(241, 241, 241) solid;
+	color: rgb(95, 95, 95);
+	font-weight: normal;
+	padding-bottom: 0.5em;
+	text-align: left;
+}
+
+.admin-email__actions div {
+	padding-top: 1.5em;
+}
+
+.login .admin-email__actions .button-primary {
+	float: none;
+	margin-left: 0.25em;
+	margin-right: 0.25em;
+}
+
 #login form p {
 	margin-bottom: 0;
 }
Index: src/wp-admin/includes/upgrade.php
===================================================================
--- src/wp-admin/includes/upgrade.php	(revision 45714)
+++ src/wp-admin/includes/upgrade.php	(working copy)
@@ -815,6 +815,10 @@
 		upgrade_510();
 	}
 
+	if ( $wp_current_db_version < 45744 ) {
+		upgrade_530();
+	}		
+
 	maybe_disable_link_manager();
 
 	maybe_disable_automattic_widgets();
@@ -2118,6 +2122,19 @@
 }
 
 /**
+ * Executes changes made in WordPress 5.3.0.
+ *
+ * @ignore
+ * @since 5.3.0
+ */
+function upgrade_530() {
+	// Do `add_option()` rather than overwriting with `update_option()` as this may run
+	// after an admin was redirected to the email verification screen,
+	// and the option was updated.
+	add_option( 'admin_email_lifespan', 0 );
+}
+
+/**
  * Executes network-level upgrade routines.
  *
  * @since 3.0.0
Index: src/wp-includes/version.php
===================================================================
--- src/wp-includes/version.php	(revision 45714)
+++ src/wp-includes/version.php	(working copy)
@@ -20,7 +20,7 @@
  *
  * @global int $wp_db_version
  */
-$wp_db_version = 44719;
+$wp_db_version = 45744;
 
 /**
  * Holds the TinyMCE version
Index: src/wp-login.php
===================================================================
--- src/wp-login.php	(revision 45714)
+++ src/wp-login.php	(working copy)
@@ -159,11 +159,14 @@
 	$login_header_text = apply_filters( 'login_headertext', $login_header_text );
 
 	$classes = array( 'login-action-' . $action, 'wp-core-ui' );
+
 	if ( is_rtl() ) {
 		$classes[] = 'rtl';
 	}
+
 	if ( $interim_login ) {
 		$classes[] = 'interim-login';
+
 		?>
 		<style type="text/css">html{background-color: transparent;}</style>
 		<?php
@@ -172,6 +175,7 @@
 			$classes[] = 'interim-login-success';
 		}
 	}
+
 	$classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
 
 	/**
@@ -194,6 +198,7 @@
 	 * @since 4.6.0
 	 */
 	do_action( 'login_header' );
+
 	?>
 	<div id="login">
 		<h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
@@ -206,6 +211,7 @@
 	 * @param string $message Login message text.
 	 */
 	$message = apply_filters( 'login_message', $message );
+
 	if ( ! empty( $message ) ) {
 		echo $message . "\n";
 	}
@@ -219,6 +225,7 @@
 	if ( $wp_error->has_errors() ) {
 		$errors   = '';
 		$messages = '';
+
 		foreach ( $wp_error->get_error_codes() as $code ) {
 			$severity = $wp_error->get_error_data( $code );
 			foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
@@ -229,6 +236,7 @@
 				}
 			}
 		}
+
 		if ( ! empty( $errors ) ) {
 			/**
 			 * Filters the error messages displayed above the login form.
@@ -239,6 +247,7 @@
 			 */
 			echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n";
 		}
+
 		if ( ! empty( $messages ) ) {
 			/**
 			 * Filters instructional messages displayed above the login form.
@@ -263,27 +272,35 @@
 	global $interim_login;
 
 	// Don't allow interim logins to navigate away from the page.
-	if ( ! $interim_login ) :
+	if ( ! $interim_login ) {
 		?>
-	<p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
+		<p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
 		<?php
+
 		/* translators: %s: site title */
 		printf( _x( '&larr; Back to %s', 'site' ), get_bloginfo( 'title', 'display' ) );
+
 		?>
-	</a></p>
-		<?php the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' ); ?>
-	<?php endif; ?>
+		</a></p>
+		<?php
 
-	</div>
+		the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' );
+	}
 
-	<?php if ( ! empty( $input_id ) ) : ?>
-	<script type="text/javascript">
-	try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
-	if(typeof wpOnload=='function')wpOnload();
-	</script>
-	<?php endif; ?>
+	?>
+	</div><?php // End of <div id="login"> ?>
 
 	<?php
+
+	if ( ! empty( $input_id ) ) {
+		?>
+		<script type="text/javascript">
+		try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
+		if(typeof wpOnload=='function')wpOnload();
+		</script>
+		<?php
+	}
+
 	/**
 	 * Fires in the login page footer.
 	 *
@@ -290,6 +307,7 @@
 	 * @since 3.1.0
 	 */
 	do_action( 'login_footer' );
+
 	?>
 	<div class="clear"></div>
 	</body>
@@ -304,13 +322,13 @@
  */
 function wp_shake_js() {
 	?>
-<script type="text/javascript">
-addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
-function s(id,pos){g(id).left=pos+'px';}
-function g(id){return document.getElementById(id).style;}
-function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}
-addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
-</script>
+	<script type="text/javascript">
+	addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
+	function s(id,pos){g(id).left=pos+'px';}
+	function g(id){return document.getElementById(id).style;}
+	function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}}
+	addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
+	</script>
 	<?php
 }
 
@@ -452,8 +470,21 @@
 	$action = 'resetpass';
 }
 
+$default_actions = array(
+	'confirm_admin_email',
+	'postpass', 'logout',
+	'lostpassword',
+	'retrievepassword',
+	'resetpass',
+	'rp',
+	'register',
+	'login',
+	'confirmaction',
+	WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED,
+);
+
 // Validate action so as to default to the login screen.
-if ( ! in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login', 'confirmaction', WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED ), true ) && false === has_filter( 'login_form_' . $action ) ) {
+if ( ! in_array( $action, $default_actions, true ) && false === has_filter( 'login_form_' . $action ) ) {
 	$action = 'login';
 }
 
@@ -467,6 +498,7 @@
 	}
 
 	$url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );
+
 	if ( $url != get_option( 'siteurl' ) ) {
 		update_option( 'siteurl', $url );
 	}
@@ -475,6 +507,7 @@
 //Set a cookie now to see if they are supported by the browser.
 $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );
 setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
+
 if ( SITECOOKIEPATH != COOKIEPATH ) {
 	setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
 }
@@ -511,10 +544,171 @@
 
 switch ( $action ) {
 
+	case 'confirm_admin_email':
+
+		// Note that `is_user_logged_in()` will return false immediately after logging in
+		// as the current user is not set, see wp-includes/pluggable.php.
+		// However this action runs on a redirect after logging in.
+		if( ! is_user_logged_in() ) {
+			wp_safe_redirect( wp_login_url() );
+			exit;
+		}
+
+		if ( ! empty( $_REQUEST['redirect_to'] ) ) {
+			$redirect_to = $_REQUEST['redirect_to'];
+		} else {
+			$redirect_to = admin_url();
+		}
+
+		if ( current_user_can( 'manage_options' ) ) {
+			$admin_email = get_option( 'admin_email' );
+		} else {
+			wp_safe_redirect( $redirect_to );
+			exit;
+		}
+
+		if ( ! empty( $_GET[ 'remind_me_later' ] ) ) {
+			if ( ! check_admin_referer( 'confirm_admin_email', 'confirm_admin_email_nonce' ) ) {
+				wp_safe_redirect( wp_login_url() );
+				exit;
+			}
+
+			// "Remind me later" is a bit ambiguous. Three days later?
+			update_option( 'admin_email_lifespan', time() + 3 * DAY_IN_SECONDS );
+
+			wp_safe_redirect( $redirect_to );
+			exit;
+		}
+
+		if ( ! empty( $_POST[ 'correct-admin-email' ] ) ) {
+			if ( ! check_admin_referer( 'confirm_admin_email', 'confirm_admin_email_nonce' ) ) {
+				wp_safe_redirect( wp_login_url() );
+				exit;
+			}
+
+			/**
+			 * Filters the interval for redirecting the user to the admin email confirmation screen.
+			 * If `0` (zero) is returned, the user will not be redirected.
+			 *
+			 * @since 5.3.0
+			 *
+			 * @param int Interval time (in seconds).
+			 */
+			$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 180 * DAY_IN_SECONDS );
+
+			update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
+
+			wp_safe_redirect( $redirect_to );
+			exit;
+		}
+
+		login_header( __( 'Confirm your admin email' ), '', $errors );
+
+		/**
+		* Fires before the admin email confirm form.
+		*
+		* @since 5.3.0
+		*
+		* @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid credentials. Note that the error object may not contain any errors.
+		*/
+		do_action( 'admin_email_confirm', $errors );
+
+		?>
+
+		<form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post">
+			<?php
+			/**
+			* Fires inside the admin-email-confirm-form form tags, before the hidden fields.
+			*
+			* @since 5.3.0
+			*/
+			do_action( 'admin_email_confirm_form' );
+
+			wp_nonce_field( 'confirm_admin_email', 'confirm_admin_email_nonce' );
+
+			?>
+			<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
+
+			<h1 class="admin-email__heading">
+				<?php _e( 'Administration email verification' ); ?>
+			</h1>
+			<p class="admin-email__details">
+				<?php _e( 'Please verify that the <strong>administration email</strong> for this website is still correct.' ); ?>
+				<?php
+
+				// TO-DO
+				/* translators: URL to help page about primary admin email. */
+				$admin_email_help_url = __( '' );
+
+				printf(
+					'<a href="%s" rel="noopener noreferrer">%s</a>',
+					esc_url( $admin_email_help_url ),
+					__( 'Why is this important?' )
+				);
+
+				?>
+			</p>
+			<p class="admin-email__details">
+				<?php
+
+				printf(
+					__( 'Current administration email: <strong>%s</strong>' ),
+					esc_html( $admin_email )
+				);
+
+				?>
+			</p>
+			<p class="admin-email__details">
+				<?php _e( 'This email may be different from your personal email address.' ); ?>
+				<?php
+
+				printf(
+					'<a href="%s" rel="noopener noreferrer">%s</a>',
+					esc_url( $admin_email_help_url ),
+					__( 'Learn more.' )
+				);
+
+				?>
+			</p>
+
+			<div class="admin-email__actions">
+				<div class="admin-email__actions-primary">
+					<?php
+
+					$change_link = admin_url( 'options-general.php' );
+					$change_link = add_query_arg( 'highlight', 'confirm_admin_email', $change_link );
+
+					?>
+					<a class="button button-large" href="<?php echo esc_url( $change_link ); ?>"><?php _e( 'Update' ); ?></a>
+					<input type="submit" name="correct-admin-email" id="correct-admin-email" class="button button-primary button-large" value="<?php esc_attr_e( 'The email is correct' ); ?>" />
+				</div>
+				<div class="admin-email__actions-secondary">
+					<?php
+
+					$remind_me_link = wp_login_url( $redirect_to );
+					$remind_me_link = add_query_arg(
+						array(
+							'action'          => 'confirm_admin_email',
+							'remind_me_later' => 'true',
+						),
+						$remind_me_link
+					);
+
+					?>
+					<a href="<?php echo esc_url( $remind_me_link ); ?>"><?php _e( 'Remind me later' ) ?></a>
+				</div>
+			</div>
+		</form>
+
+		<?php
+
+		login_footer();
+		break;
+
 	case 'postpass':
 		if ( ! array_key_exists( 'post_password', $_POST ) ) {
 			wp_safe_redirect( wp_get_referer() );
-			exit();
+			exit;
 		}
 
 		require_once ABSPATH . WPINC . '/class-phpass.php';
@@ -532,11 +726,13 @@
 		 */
 		$expire  = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );
 		$referer = wp_get_referer();
+
 		if ( $referer ) {
 			$secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) );
 		} else {
 			$secure = false;
 		}
+
 		setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
 
 		wp_safe_redirect( wp_get_referer() );
@@ -553,7 +749,7 @@
 			$redirect_to           = $_REQUEST['redirect_to'];
 			$requested_redirect_to = $redirect_to;
 		} else {
-			$redirect_to           = add_query_arg(
+			$redirect_to = add_query_arg(
 				array(
 					'loggedout' => 'true',
 					'wp_lang'   => get_user_locale( $user ),
@@ -560,6 +756,7 @@
 				),
 				wp_login_url()
 			);
+
 			$requested_redirect_to = '';
 		}
 
@@ -573,6 +770,7 @@
 		 * @param WP_User $user                  The WP_User object for the user that's logging out.
 		 */
 		$redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );
+
 		wp_safe_redirect( $redirect_to );
 		exit();
 
@@ -580,6 +778,7 @@
 	case 'retrievepassword':
 		if ( $http_post ) {
 			$errors = retrieve_password();
+
 			if ( ! is_wp_error( $errors ) ) {
 				$redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
 				wp_safe_redirect( $redirect_to );
@@ -626,40 +825,45 @@
 
 		?>
 
-	<form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
-	<p>
-		<label for="user_login" ><?php _e( 'Username or Email Address' ); ?><br />
-		<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
-	</p>
-		<?php
-		/**
-		 * Fires inside the lostpassword form tags, before the hidden fields.
-		 *
-		 * @since 2.1.0
-		 */
-		do_action( 'lostpassword_form' );
-		?>
-		<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
-		<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Get New Password' ); ?>" /></p>
-	</form>
+		<form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
+			<p>
+				<label for="user_login" ><?php _e( 'Username or Email Address' ); ?><br />
+				<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
+			</p>
+			<?php
 
-	<p id="nav">
-	<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
-		<?php
-		if ( get_option( 'users_can_register' ) ) :
-			$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
+			/**
+			 * Fires inside the lostpassword form tags, before the hidden fields.
+			 *
+			 * @since 2.1.0
+			 */
+			do_action( 'lostpassword_form' );
 
-			echo esc_html( $login_link_separator );
+			?>
+			<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
+			<p class="submit">
+				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Get New Password' ); ?>" />
+			</p>
+		</form>
 
-			/** This filter is documented in wp-includes/general-template.php */
-			echo apply_filters( 'register', $registration_url );
-	endif;
-		?>
-	</p>
+		<p id="nav">
+			<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
+			<?php
 
+			if ( get_option( 'users_can_register' ) ) {
+				$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
+
+				echo esc_html( $login_link_separator );
+
+				/** This filter is documented in wp-includes/general-template.php */
+				echo apply_filters( 'register', $registration_url );
+			}
+
+			?>
+		</p>
 		<?php
+
 		login_footer( 'user_login' );
-
 		break;
 
 	case 'resetpass':
@@ -666,9 +870,11 @@
 	case 'rp':
 		list( $rp_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );
 		$rp_cookie       = 'wp-resetpass-' . COOKIEHASH;
+
 		if ( isset( $_GET['key'] ) ) {
 			$value = sprintf( '%s:%s', wp_unslash( $_GET['login'] ), wp_unslash( $_GET['key'] ) );
 			setcookie( $rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
+
 			wp_safe_redirect( remove_query_arg( array( 'key', 'login' ) ) );
 			exit;
 		}
@@ -675,7 +881,9 @@
 
 		if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
 			list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
-			$user                      = check_password_reset_key( $rp_key, $rp_login );
+
+			$user = check_password_reset_key( $rp_key, $rp_login );
+
 			if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
 				$user = false;
 			}
@@ -685,11 +893,13 @@
 
 		if ( ! $user || is_wp_error( $user ) ) {
 			setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
+
 			if ( $user && $user->get_error_code() === 'expired_key' ) {
 				wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) );
 			} else {
 				wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) );
 			}
+
 			exit;
 		}
 
@@ -723,70 +933,75 @@
 		login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below.' ) . '</p>', $errors );
 
 		?>
-	<form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off">
-	<input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
+		<form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off">
+			<input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
 
-	<div class="user-pass1-wrap">
-		<p>
-			<label for="pass1"><?php _e( 'New password' ); ?></label>
-		</p>
+			<div class="user-pass1-wrap">
+				<p>
+					<label for="pass1"><?php _e( 'New password' ); ?></label>
+				</p>
 
-		<div class="wp-pwd">
-			<div class="password-input-wrapper">
-				<input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input password-input" size="24" value="" autocomplete="off" aria-describedby="pass-strength-result" />
-				<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js">
-					<span class="dashicons dashicons-hidden" aria-hidden="true"></span>
-				</button>
+				<div class="wp-pwd">
+					<div class="password-input-wrapper">
+						<input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input password-input" size="24" value="" autocomplete="off" aria-describedby="pass-strength-result" />
+						<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js">
+							<span class="dashicons dashicons-hidden" aria-hidden="true"></span>
+						</button>
+					</div>
+					<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
+				</div>
+				<div class="pw-weak">
+					<label>
+						<input type="checkbox" name="pw_weak" class="pw-checkbox" />
+						<?php _e( 'Confirm use of weak password' ); ?>
+					</label>
+				</div>
 			</div>
-			<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
-		</div>
-		<div class="pw-weak">
-			<label>
-				<input type="checkbox" name="pw_weak" class="pw-checkbox" />
-				<?php _e( 'Confirm use of weak password' ); ?>
-			</label>
-		</div>
-	</div>
 
-	<p class="user-pass2-wrap">
-		<label for="pass2"><?php _e( 'Confirm new password' ); ?></label><br />
-		<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
-	</p>
+			<p class="user-pass2-wrap">
+				<label for="pass2"><?php _e( 'Confirm new password' ); ?></label><br />
+				<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
+			</p>
 
-	<p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
-	<br class="clear" />
+			<p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
+			<br class="clear" />
 
-		<?php
-		/**
-		 * Fires following the 'Strength indicator' meter in the user password reset form.
-		 *
-		 * @since 3.9.0
-		 *
-		 * @param WP_User $user User object of the user whose password is being reset.
-		 */
-		do_action( 'resetpass_form', $user );
-		?>
-	<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
-	<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Reset Password' ); ?>" /></p>
-	</form>
+			<?php
 
-	<p id="nav">
-	<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
-		<?php
-		if ( get_option( 'users_can_register' ) ) :
-			$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
+			/**
+			 * Fires following the 'Strength indicator' meter in the user password reset form.
+			 *
+			 * @since 3.9.0
+			 *
+			 * @param WP_User $user User object of the user whose password is being reset.
+			 */
+			do_action( 'resetpass_form', $user );
 
-			echo esc_html( $login_link_separator );
+			?>
+			<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
+			<p class="submit">
+				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Reset Password' ); ?>" />
+			</p>
+		</form>
 
-			/** This filter is documented in wp-includes/general-template.php */
-			echo apply_filters( 'register', $registration_url );
-	endif;
-		?>
-	</p>
+		<p id="nav">
+			<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
+			<?php
 
+			if ( get_option( 'users_can_register' ) ) {
+				$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
+
+				echo esc_html( $login_link_separator );
+
+				/** This filter is documented in wp-includes/general-template.php */
+				echo apply_filters( 'register', $registration_url );
+			}
+
+			?>
+		</p>
 		<?php
+
 		login_footer( 'user_pass' );
-
 		break;
 
 	case 'register':
@@ -820,6 +1035,7 @@
 			}
 
 			$errors = register_new_user( $user_login, $user_email );
+
 			if ( ! is_wp_error( $errors ) ) {
 				$redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
 				wp_safe_redirect( $redirect_to );
@@ -828,6 +1044,7 @@
 		}
 
 		$registration_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
+
 		/**
 		 * Filters the registration redirect URL.
 		 *
@@ -836,40 +1053,47 @@
 		 * @param string $registration_redirect The redirect destination URL.
 		 */
 		$redirect_to = apply_filters( 'registration_redirect', $registration_redirect );
+
 		login_header( __( 'Registration Form' ), '<p class="message register">' . __( 'Register For This Site' ) . '</p>', $errors );
+
 		?>
-	<form name="registerform" id="registerform" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post" novalidate="novalidate">
-	<p>
-		<label for="user_login"><?php _e( 'Username' ); ?><br />
-		<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( wp_unslash( $user_login ) ); ?>" size="20" autocapitalize="off" /></label>
-	</p>
-	<p>
-		<label for="user_email"><?php _e( 'Email' ); ?><br />
-		<input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
-	</p>
-		<?php
-		/**
-		 * Fires following the 'Email' field in the user registration form.
-		 *
-		 * @since 2.1.0
-		 */
-		do_action( 'register_form' );
-		?>
-	<p id="reg_passmail"><?php _e( 'Registration confirmation will be emailed to you.' ); ?></p>
-	<br class="clear" />
-	<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
-	<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Register' ); ?>" /></p>
-	</form>
+		<form name="registerform" id="registerform" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post" novalidate="novalidate">
+			<p>
+				<label for="user_login"><?php _e( 'Username' ); ?><br />
+				<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( wp_unslash( $user_login ) ); ?>" size="20" autocapitalize="off" /></label>
+			</p>
+			<p>
+				<label for="user_email"><?php _e( 'Email' ); ?><br />
+				<input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
+			</p>
+			<?php
 
-	<p id="nav">
-	<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
-		<?php echo esc_html( $login_link_separator ); ?>
-	<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
-	</p>
+			/**
+			 * Fires following the 'Email' field in the user registration form.
+			 *
+			 * @since 2.1.0
+			 */
+			do_action( 'register_form' );
 
+			?>
+			<p id="reg_passmail">
+				<?php _e( 'Registration confirmation will be emailed to you.' ); ?>
+			</p>
+			<br class="clear" />
+			<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
+			<p class="submit">
+				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Register' ); ?>" />
+			</p>
+		</form>
+
+		<p id="nav">
+			<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
+				<?php echo esc_html( $login_link_separator ); ?>
+			<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
+		</p>
 		<?php
+
 		login_footer( 'user_login' );
-
 		break;
 
 	case 'confirmaction':
@@ -914,6 +1138,7 @@
 	default:
 		$secure_cookie   = '';
 		$customize_login = isset( $_REQUEST['customize-login'] );
+
 		if ( $customize_login ) {
 			wp_enqueue_script( 'customize-base' );
 		}
@@ -990,20 +1215,41 @@
 				$message       = '<p class="message">' . __( 'You have logged in successfully.' ) . '</p>';
 				$interim_login = 'success';
 				login_header( '', $message );
+
 				?>
 				</div>
 				<?php
+
 				/** This action is documented in wp-login.php */
 				do_action( 'login_footer' );
+
+				if ( $customize_login ) {
+					?>
+					<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
+					<?php
+				}
+
 				?>
-				<?php if ( $customize_login ) : ?>
-				<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
-			<?php endif; ?>
 				</body></html>
 				<?php
+
 				exit;
 			}
 
+			// Check if it is time to add a redirect to the admin email confirmation screen.
+			if ( is_a( $user, 'WP_User' ) && $user->exists() && $user->has_cap( 'manage_options' ) ) {
+				$admin_email_lifespan = (int) get_option( 'admin_email_lifespan' );
+
+				// If `0` (or anything "falsey" as it is cast to int) is returned, the user will not be redirected
+				// to the admin email confirmation screen.
+				/** This filter is documented in wp-login.php */
+				$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 180 * DAY_IN_SECONDS );
+
+				if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
+					$redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
+				}
+			}
+
 			if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
 				// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
 				if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
@@ -1015,10 +1261,11 @@
 				}
 
 				wp_redirect( $redirect_to );
-				exit();
+				exit;
 			}
+
 			wp_safe_redirect( $redirect_to );
-			exit();
+			exit;
 		}
 
 		$errors = $user;
@@ -1074,6 +1321,7 @@
 		if ( isset( $_POST['log'] ) ) {
 			$user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';
 		}
+
 		$rememberme = ! empty( $_POST['rememberme'] );
 
 		if ( $errors->has_errors() ) {
@@ -1081,45 +1329,60 @@
 		} else {
 			$aria_describedby_error = '';
 		}
-		?>
 
-	<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
-	<p>
-		<label for="user_login"><?php _e( 'Username or Email Address' ); ?><br />
-		<input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
-	</p>
-	<p>
-		<label for="user_pass"><?php _e( 'Password' ); ?><br />
-		<input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>
-	</p>
-		<?php
-		/**
-		 * Fires following the 'Password' field in the login form.
-		 *
-		 * @since 2.1.0
-		 */
-		do_action( 'login_form' );
 		?>
-	<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <?php esc_html_e( 'Remember Me' ); ?></label></p>
-	<p class="submit">
-		<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" />
-		<?php	if ( $interim_login ) { ?>
-		<input type="hidden" name="interim-login" value="1" />
-	<?php	} else { ?>
-		<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
-	<?php } ?>
-		<?php if ( $customize_login ) : ?>
-		<input type="hidden" name="customize-login" value="1" />
-	<?php endif; ?>
-		<input type="hidden" name="testcookie" value="1" />
-	</p>
-	</form>
 
-		<?php if ( ! $interim_login ) { ?>
-	<p id="nav">
+		<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
+			<p>
+				<label for="user_login"><?php _e( 'Username or Email Address' ); ?><br />
+				<input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
+			</p>
+			<p>
+				<label for="user_pass"><?php _e( 'Password' ); ?><br />
+				<input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>
+			</p>
 			<?php
-			if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
-				if ( get_option( 'users_can_register' ) ) :
+
+			/**
+			 * Fires following the 'Password' field in the login form.
+			 *
+			 * @since 2.1.0
+			 */
+			do_action( 'login_form' );
+
+			?>
+			<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <?php esc_html_e( 'Remember Me' ); ?></label></p>
+			<p class="submit">
+				<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" />
+				<?php
+
+				if ( $interim_login ) {
+					?>
+					<input type="hidden" name="interim-login" value="1" />
+					<?php
+				} else {
+					?>
+					<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
+					<?php
+				}
+
+				if ( $customize_login ) {
+					?>
+					<input type="hidden" name="customize-login" value="1" />
+					<?php
+				}
+
+				?>
+				<input type="hidden" name="testcookie" value="1" />
+			</p>
+		</form>
+
+		<?php if ( ! $interim_login ) : ?>
+		<p id="nav">
+			<?php
+
+			if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) {
+				if ( get_option( 'users_can_register' ) ) {
 					$registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
 
 					/** This filter is documented in wp-includes/general-template.php */
@@ -1126,35 +1389,36 @@
 					echo apply_filters( 'register', $registration_url );
 
 					echo esc_html( $login_link_separator );
-				endif;
+				}
+
 				?>
-		<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
-			<?php endif; ?>
-	</p>
-	<?php } ?>
-
-	<script type="text/javascript">
-	function wp_attempt_focus(){
-	setTimeout( function(){ try{
-		<?php if ( $user_login ) { ?>
-	d = document.getElementById('user_pass');
-	d.value = '';
-	<?php } else { ?>
-	d = document.getElementById('user_login');
-			<?php if ( 'invalid_username' == $errors->get_error_code() ) { ?>
-	if( d.value != '' )
-	d.value = '';
+				<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
 				<?php
 			}
-	}
-	?>
-	d.focus();
-	d.select();
-	} catch(e){}
-	}, 200);
-	}
 
-		<?php
+			?>
+		</p>
+		<?php endif; // ! $interim_login
+
+		$login_script = "function wp_attempt_focus() {";
+		$login_script .= "setTimeout( function() {";
+		$login_script .= "try {";
+
+		if ( $user_login ) {
+			$login_script .= "d = document.getElementById( 'user_pass' ); d.value = '';";
+		} else {
+			$login_script .= "d = document.getElementById( 'user_login' );";
+
+			if ( $errors->get_error_code() === 'invalid_username' ) {
+				$login_script .= "d.value = '';";
+			}
+		}
+
+		$login_script .= "d.focus(); d.select();";
+		$login_script .= "} catch( er ) {}";
+		$login_script .= "}, 200);";
+		$login_script .= "}\n"; // End of wp_attempt_focus().
+
 		/**
 		 * Filters whether to print the call to `wp_attempt_focus()` on the login screen.
 		 *
@@ -1163,25 +1427,36 @@
 		 * @param bool $print Whether to print the function call. Default true.
 		 */
 		if ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) {
+			$login_script .= "wp_attempt_focus();\n";
+		}
+
+		// Run `wpOnload()` if defined.
+		$login_script .= "if ( typeof wpOnload === 'function' ) { wpOnload() }";
+
+		?>
+		<script type="text/javascript">
+			<?php echo $login_script; ?>
+		</script>
+		<?php
+
+		if ( $interim_login ) {
 			?>
-	wp_attempt_focus();
-		<?php } ?>
-	if(typeof wpOnload=='function')wpOnload();
-		<?php if ( $interim_login ) { ?>
-	(function(){
-	try {
-		var i, links = document.getElementsByTagName('a');
-		for ( i in links ) {
-			if ( links[i].href )
-				links[i].target = '_blank';
+			<script type="text/javascript">
+			( function() {
+				try {
+					var i, links = document.getElementsByTagName( 'a' );
+					for ( i in links ) {
+						if ( links[i].href ) {
+							links[i].target = '_blank';
+							links[i].rel = 'noreferrer noopener';
+						}
+					}
+				} catch( er ) {}
+			}());
+			</script>
+			<?php
 		}
-	} catch(e){}
-	}());
-	<?php } ?>
-	</script>
 
-		<?php
 		login_footer();
-
 		break;
 } // End action switch.
