- // Some parts of this script use the main login form to display a message
- if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )
- $errors->add('loggedout', __('You are now logged out.'), 'message');
- 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 e-mail for the confirmation link.'), 'message');
- elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
- $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
- elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
- $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
- elseif ( $interim_login )
- $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');
+ if ( $interim_login ) {
+ if ( ! $errors->get_error_code() )
+ $errors->add('expired', __('Session expired. Please log in again. You will not move away from this page.'), 'message');
+ } else {
+ // Some parts of this script use the main login form to display a message
+ if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] )
+ $errors->add('loggedout', __('You are now logged out.'), 'message');
+ 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 e-mail for the confirmation link.'), 'message');
+ elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
+ $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
+ elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
+ $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
+ elseif ( strpos( $redirect_to, 'about.php?updated' ) )
+ $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' );
+ }
+
+ $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );