Make WordPress Core

Ticket #40605: 40605.2.patch

File 40605.2.patch, 1.5 KB (added by yashrs, 7 years ago)

Added link(to login page) and text to ensure that user isn't confused where to go next.

  • wp-login.php

    diff --git a/wp-login.php b/wp-login.php
    index 5159eab6ff..bec2cef4fc 100644
    a b if ( isset($_GET['key']) ) 
    406406if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
    407407        $action = 'login';
    408408
     409if ( isset($_GET['checkemail']) && $_GET['checkemail'] )
     410        $action = 'check-email';
     411
    409412nocache_headers();
    410413
    411414header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
    if ( $switched_locale ) { 
    828831
    829832break;
    830833
     834case 'check-email' :
     835        $secure_cookie = '';
     836
     837        $redirect_to = admin_url();
     838
     839
     840
     841        $reauth = empty($_REQUEST['reauth']) ? false : true;
     842
     843        $user = wp_signon( array(), $secure_cookie );
     844        $errors = $user;
     845        // Clear errors if loggedout is set.
     846        if ( !empty($_GET['loggedout']) || $reauth ) {
     847                $errors = new WP_Error();
     848        }
     849
     850        if ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] ) {
     851                $errors->add('confirm', __('Check your email for the confirmation link. Then go to <a href="'.wp_login_url().'">Login Page</a>'), 'message');
     852        }
     853
     854        /**
     855         * Filters the login page errors.
     856         *
     857         * @since 3.6.0
     858         *
     859         * @param object $errors      WP Error object.
     860         * @param string $redirect_to Redirect destination URL.
     861         */
     862        $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
     863        login_header(__('Log In'), '', $errors);
     864
     865login_footer();
     866break;
     867   
    831868case 'login' :
    832869default:
    833870        $secure_cookie = '';