+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+ /**
+ * 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 );
-
-
-
-
+ ?>
+
+
+
+
+
-
-
- %s', esc_url( wp_registration_url() ), __( 'Register' ) );
+
+
+ %s', 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 );
- endif;
- ?>
-
+ /** This filter is documented in wp-includes/general-template.php */
+ echo apply_filters( 'register', $registration_url );
+ }
+ ?>
+
' . __( 'Register For This Site' ) . '', $errors );
+
?>
-
+
+
+
+
+
+
-
-
-
-
-
+
+ login_footer( 'user_login' );
+ break;
+
+ case 'checkemail':
+ $redirect_to = admin_url();
+ $errors = new WP_Error();
-
-
-
-
-
+ if ( 'confirm' === $_GET['checkemail'] ) {
+ $errors->add(
+ 'confirm',
+ sprintf(
+ /* translators: %s: Link to the login page. */
+ __( 'Check your email for the confirmation link, then visit the
login page .' ),
+ wp_login_url()
+ ),
+ 'message'
+ );
+ } elseif ( 'registered' === $_GET['checkemail'] ) {
+ $errors->add(
+ 'registered',
+ sprintf(
+ /* translators: %s: Link to the login page. */
+ __( 'Registration complete. Please check your email, then visit the
login page .' ),
+ wp_login_url()
+ ),
+ 'message'
+ );
+ }
- ERROR: Cookies are blocked due to unexpected output. For help, please see
this documentation or try the
support forums .' ),
+ /* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */
+ __( '
Error : Cookies are blocked due to unexpected output. For help, please see
this documentation or try the
support forums .' ),
__( 'https://wordpress.org/support/article/cookies/' ),
- __( 'https://wordpress.org/support/' )
+ __( 'https://wordpress.org/support/forums/' )
)
);
} elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
- // If cookies are disabled we can't log in even with a valid user+pass
+ // If cookies are disabled, we can't log in even with a valid user and password.
$user = new WP_Error(
'test_cookie',
sprintf(
- /* translators: %s: Browser cookie documentation URL */
- __( '
ERROR : Cookies are blocked or not supported by your browser. You must
enable cookies to use WordPress.' ),
+ /* translators: %s: Browser cookie documentation URL. */
+ __( '
Error : Cookies are blocked or not supported by your browser. You must
enable cookies to use WordPress.' ),
__( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )
)
);
@@ -974,21 +1288,48 @@
$message = '
' . __( 'You have logged in successfully.' ) . '
';
$interim_login = 'success';
login_header( '', $message );
+
?>
+
+
-
-
-
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', 6 * MONTH_IN_SECONDS );
+
+ if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
+ $redirect_to = add_query_arg(
+ array(
+ 'action' => 'confirm_admin_email',
+ 'wp_lang' => get_user_locale( $user ),
+ ),
+ wp_login_url( $redirect_to )
+ );
+ }
+ }
+
+ if ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) {
// 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 ) ) {
$redirect_to = user_admin_url();
@@ -999,10 +1340,11 @@
}
wp_redirect( $redirect_to );
- exit();
+ exit;
}
+
wp_safe_redirect( $redirect_to );
- exit();
+ exit;
}
$errors = $user;
@@ -1021,16 +1363,10 @@
}
} else {
// Some parts of this script use the main login form to display a message.
- if ( isset( $_GET['loggedout'] ) && true == $_GET['loggedout'] ) {
+ if ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] ) {
$errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );
- } elseif ( isset( $_GET['registration'] ) && 'disabled' == $_GET['registration'] ) {
+ } elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) {
$errors->add( 'registerdisabled', __( 'User registration is currently not allowed.' ) );
- } elseif ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] ) {
- $errors->add( 'confirm', __( 'Check your email for the confirmation link.' ), 'message' );
- } elseif ( isset( $_GET['checkemail'] ) && 'newpass' == $_GET['checkemail'] ) {
- $errors->add( 'newpass', __( 'Check your email for your new password.' ), 'message' );
- } elseif ( isset( $_GET['checkemail'] ) && 'registered' == $_GET['checkemail'] ) {
- $errors->add( 'registered', __( 'Registration complete. Please check your email.' ), 'message' );
} elseif ( strpos( $redirect_to, 'about.php?updated' ) ) {
$errors->add( 'updated', __( '