[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/ -> wp-login.php (source)

   1  <?php
   2  /**
   3   * WordPress User Page
   4   *
   5   * Handles authentication, registering, resetting passwords, forgot password,
   6   * and other user handling.
   7   *
   8   * @package WordPress
   9   */
  10  
  11  /** Make sure that the WordPress bootstrap has run before continuing. */
  12  require( dirname( __FILE__ ) . '/wp-load.php' );
  13  
  14  // Redirect to HTTPS login if forced to use SSL.
  15  if ( force_ssl_admin() && ! is_ssl() ) {
  16      if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
  17          wp_safe_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
  18          exit();
  19      } else {
  20          wp_safe_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
  21          exit();
  22      }
  23  }
  24  
  25  /**
  26   * Output the login page header.
  27   *
  28   * @since 2.1.0
  29   *
  30   * @param string   $title    Optional. WordPress login Page title to display in the `<title>` element.
  31   *                           Default 'Log In'.
  32   * @param string   $message  Optional. Message to display in header. Default empty.
  33   * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance.
  34   */
  35  function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
  36      global $error, $interim_login, $action;
  37  
  38      // Don't index any of these forms
  39      add_action( 'login_head', 'wp_sensitive_page_meta' );
  40  
  41      add_action( 'login_head', 'wp_login_viewport_meta' );
  42  
  43      if ( ! is_wp_error( $wp_error ) ) {
  44          $wp_error = new WP_Error();
  45      }
  46  
  47      // Shake it!
  48      $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
  49      /**
  50       * Filters the error codes array for shaking the login form.
  51       *
  52       * @since 3.0.0
  53       *
  54       * @param array $shake_error_codes Error codes that shake the login form.
  55       */
  56      $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
  57  
  58      if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) {
  59          add_action( 'login_head', 'wp_shake_js', 12 );
  60      }
  61  
  62      $login_title = get_bloginfo( 'name', 'display' );
  63  
  64      /* translators: Login screen title. 1: Login screen name, 2: Network or site name */
  65      $login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $login_title );
  66  
  67      if ( wp_is_recovery_mode() ) {
  68          /* translators: %s: Login screen title. */
  69          $login_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $login_title );
  70      }
  71  
  72      /**
  73       * Filters the title tag content for login page.
  74       *
  75       * @since 4.9.0
  76       *
  77       * @param string $login_title The page title, with extra context added.
  78       * @param string $title       The original page title.
  79       */
  80      $login_title = apply_filters( 'login_title', $login_title, $title );
  81  
  82      ?><!DOCTYPE html>
  83      <!--[if IE 8]>
  84          <html xmlns="http://www.w3.org/1999/xhtml" class="ie8" <?php language_attributes(); ?>>
  85      <![endif]-->
  86      <!--[if !(IE 8) ]><!-->
  87          <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  88      <!--<![endif]-->
  89      <head>
  90      <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
  91      <title><?php echo $login_title; ?></title>
  92      <?php
  93  
  94      wp_enqueue_style( 'login' );
  95  
  96      /*
  97       * Remove all stored post data on logging out.
  98       * This could be added by add_action('login_head'...) like wp_shake_js(),
  99       * but maybe better if it's not removable by plugins.
 100       */
 101      if ( 'loggedout' == $wp_error->get_error_code() ) {
 102          ?>
 103          <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
 104          <?php
 105      }
 106  
 107      /**
 108       * Enqueue scripts and styles for the login page.
 109       *
 110       * @since 3.1.0
 111       */
 112      do_action( 'login_enqueue_scripts' );
 113  
 114      /**
 115       * Fires in the login page header after scripts are enqueued.
 116       *
 117       * @since 2.1.0
 118       */
 119      do_action( 'login_head' );
 120  
 121      $login_header_url = __( 'https://wordpress.org/' );
 122  
 123      /**
 124       * Filters link URL of the header logo above login form.
 125       *
 126       * @since 2.1.0
 127       *
 128       * @param string $login_header_url Login header logo URL.
 129       */
 130      $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
 131  
 132      $login_header_title = '';
 133  
 134      /**
 135       * Filters the title attribute of the header logo above login form.
 136       *
 137       * @since 2.1.0
 138       * @deprecated 5.2.0 Use login_headertext
 139       *
 140       * @param string $login_header_title Login header logo title attribute.
 141       */
 142      $login_header_title = apply_filters_deprecated(
 143          'login_headertitle',
 144          array( $login_header_title ),
 145          '5.2.0',
 146          'login_headertext',
 147          __( 'Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead.' )
 148      );
 149  
 150      $login_header_text = empty( $login_header_title ) ? __( 'Powered by WordPress' ) : $login_header_title;
 151  
 152      /**
 153       * Filters the link text of the header logo above the login form.
 154       *
 155       * @since 5.2.0
 156       *
 157       * @param string $login_header_text The login header logo link text.
 158       */
 159      $login_header_text = apply_filters( 'login_headertext', $login_header_text );
 160  
 161      $classes = array( 'login-action-' . $action, 'wp-core-ui' );
 162      if ( is_rtl() ) {
 163          $classes[] = 'rtl';
 164      }
 165      if ( $interim_login ) {
 166          $classes[] = 'interim-login';
 167          ?>
 168          <style type="text/css">html{background-color: transparent;}</style>
 169          <?php
 170  
 171          if ( 'success' === $interim_login ) {
 172              $classes[] = 'interim-login-success';
 173          }
 174      }
 175      $classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
 176  
 177      /**
 178       * Filters the login page body classes.
 179       *
 180       * @since 3.5.0
 181       *
 182       * @param array  $classes An array of body classes.
 183       * @param string $action  The action that brought the visitor to the login page.
 184       */
 185      $classes = apply_filters( 'login_body_class', $classes, $action );
 186  
 187      ?>
 188      </head>
 189      <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
 190      <?php
 191      /**
 192       * Fires in the login page header after the body tag is opened.
 193       *
 194       * @since 4.6.0
 195       */
 196      do_action( 'login_header' );
 197      ?>
 198      <div id="login">
 199          <h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
 200      <?php
 201      /**
 202       * Filters the message to display above the login form.
 203       *
 204       * @since 2.1.0
 205       *
 206       * @param string $message Login message text.
 207       */
 208      $message = apply_filters( 'login_message', $message );
 209      if ( ! empty( $message ) ) {
 210          echo $message . "\n";
 211      }
 212  
 213      // In case a plugin uses $error rather than the $wp_errors object.
 214      if ( ! empty( $error ) ) {
 215          $wp_error->add( 'error', $error );
 216          unset( $error );
 217      }
 218  
 219      if ( $wp_error->has_errors() ) {
 220          $errors   = '';
 221          $messages = '';
 222          foreach ( $wp_error->get_error_codes() as $code ) {
 223              $severity = $wp_error->get_error_data( $code );
 224              foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
 225                  if ( 'message' == $severity ) {
 226                      $messages .= '    ' . $error_message . "<br />\n";
 227                  } else {
 228                      $errors .= '    ' . $error_message . "<br />\n";
 229                  }
 230              }
 231          }
 232          if ( ! empty( $errors ) ) {
 233              /**
 234               * Filters the error messages displayed above the login form.
 235               *
 236               * @since 2.1.0
 237               *
 238               * @param string $errors Login error message.
 239               */
 240              echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n";
 241          }
 242          if ( ! empty( $messages ) ) {
 243              /**
 244               * Filters instructional messages displayed above the login form.
 245               *
 246               * @since 2.5.0
 247               *
 248               * @param string $messages Login messages.
 249               */
 250              echo '<p class="message">' . apply_filters( 'login_messages', $messages ) . "</p>\n";
 251          }
 252      }
 253  } // End of login_header()
 254  
 255  /**
 256   * Outputs the footer for the login page.
 257   *
 258   * @since 3.1.0
 259   *
 260   * @param string $input_id Which input to auto-focus.
 261   */
 262  function login_footer( $input_id = '' ) {
 263      global $interim_login;
 264  
 265      // Don't allow interim logins to navigate away from the page.
 266      if ( ! $interim_login ) :
 267          ?>
 268      <p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
 269          <?php
 270          /* translators: %s: site title */
 271          printf( _x( '&larr; Back to %s', 'site' ), get_bloginfo( 'title', 'display' ) );
 272          ?>
 273      </a></p>
 274          <?php the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' ); ?>
 275      <?php endif; ?>
 276  
 277      </div>
 278  
 279      <?php if ( ! empty( $input_id ) ) : ?>
 280      <script type="text/javascript">
 281      try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
 282      if(typeof wpOnload=='function')wpOnload();
 283      </script>
 284      <?php endif; ?>
 285  
 286      <?php
 287      /**
 288       * Fires in the login page footer.
 289       *
 290       * @since 3.1.0
 291       */
 292      do_action( 'login_footer' );
 293      ?>
 294      <div class="clear"></div>
 295      </body>
 296      </html>
 297      <?php
 298  }
 299  
 300  /**
 301   * Outputs the Javascript to handle the form shaking.
 302   *
 303   * @since 3.0.0
 304   */
 305  function wp_shake_js() {
 306      ?>
 307  <script type="text/javascript">
 308  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();}}};
 309  function s(id,pos){g(id).left=pos+'px';}
 310  function g(id){return document.getElementById(id).style;}
 311  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){}}}
 312  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);});
 313  </script>
 314      <?php
 315  }
 316  
 317  /**
 318   * Outputs the viewport meta tag.
 319   *
 320   * @since 3.7.0
 321   */
 322  function wp_login_viewport_meta() {
 323      ?>
 324      <meta name="viewport" content="width=device-width" />
 325      <?php
 326  }
 327  
 328  /**
 329   * Handles sending password retrieval email to user.
 330   *
 331   * @since 2.5.0
 332   *
 333   * @return bool|WP_Error True: when finish. WP_Error on error
 334   */
 335  function retrieve_password() {
 336      $errors = new WP_Error();
 337  
 338      if ( empty( $_POST['user_login'] ) || ! is_string( $_POST['user_login'] ) ) {
 339          $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Enter a username or email address.' ) );
 340      } elseif ( strpos( $_POST['user_login'], '@' ) ) {
 341          $user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) );
 342          if ( empty( $user_data ) ) {
 343              $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: There is no account with that username or email address.' ) );
 344          }
 345      } else {
 346          $login     = trim( $_POST['user_login'] );
 347          $user_data = get_user_by( 'login', $login );
 348      }
 349  
 350      /**
 351       * Fires before errors are returned from a password reset request.
 352       *
 353       * @since 2.1.0
 354       * @since 4.4.0 Added the `$errors` parameter.
 355       *
 356       * @param WP_Error $errors A WP_Error object containing any errors generated
 357       *                         by using invalid credentials.
 358       */
 359      do_action( 'lostpassword_post', $errors );
 360  
 361      if ( $errors->has_errors() ) {
 362          return $errors;
 363      }
 364  
 365      if ( ! $user_data ) {
 366          $errors->add( 'invalidcombo', __( '<strong>ERROR</strong>: There is no account with that username or email address.' ) );
 367          return $errors;
 368      }
 369  
 370      // Redefining user_login ensures we return the right case in the email.
 371      $user_login = $user_data->user_login;
 372      $user_email = $user_data->user_email;
 373      $key        = get_password_reset_key( $user_data );
 374  
 375      if ( is_wp_error( $key ) ) {
 376          return $key;
 377      }
 378  
 379      if ( is_multisite() ) {
 380          $site_name = get_network()->site_name;
 381      } else {
 382          /*
 383           * The blogname option is escaped with esc_html on the way into the database
 384           * in sanitize_option we want to reverse this for the plain text arena of emails.
 385           */
 386          $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
 387      }
 388  
 389      $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
 390      /* translators: %s: site name */
 391      $message .= sprintf( __( 'Site Name: %s' ), $site_name ) . "\r\n\r\n";
 392      /* translators: %s: user login */
 393      $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n\r\n";
 394      $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.' ) . "\r\n\r\n";
 395      $message .= __( 'To reset your password, visit the following address:' ) . "\r\n\r\n";
 396      $message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . ">\r\n";
 397  
 398      /* translators: Password reset notification email subject. %s: Site title */
 399      $title = sprintf( __( '[%s] Password Reset' ), $site_name );
 400  
 401      /**
 402       * Filters the subject of the password reset email.
 403       *
 404       * @since 2.8.0
 405       * @since 4.4.0 Added the `$user_login` and `$user_data` parameters.
 406       *
 407       * @param string  $title      Default email title.
 408       * @param string  $user_login The username for the user.
 409       * @param WP_User $user_data  WP_User object.
 410       */
 411      $title = apply_filters( 'retrieve_password_title', $title, $user_login, $user_data );
 412  
 413      /**
 414       * Filters the message body of the password reset mail.
 415       *
 416       * If the filtered message is empty, the password reset email will not be sent.
 417       *
 418       * @since 2.8.0
 419       * @since 4.1.0 Added `$user_login` and `$user_data` parameters.
 420       *
 421       * @param string  $message    Default mail message.
 422       * @param string  $key        The activation key.
 423       * @param string  $user_login The username for the user.
 424       * @param WP_User $user_data  WP_User object.
 425       */
 426      $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
 427  
 428      if ( $message && ! wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) {
 429          wp_die( __( 'The email could not be sent.' ) . "<br />\n" . __( 'Possible reason: your host may have disabled the mail() function.' ) );
 430      }
 431  
 432      return true;
 433  }
 434  
 435  //
 436  // Main.
 437  //
 438  
 439  $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';
 440  $errors = new WP_Error();
 441  
 442  if ( isset( $_GET['key'] ) ) {
 443      $action = 'resetpass';
 444  }
 445  
 446  // Validate action so as to default to the login screen.
 447  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 ) ) {
 448      $action = 'login';
 449  }
 450  
 451  nocache_headers();
 452  
 453  header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );
 454  
 455  if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set
 456      if ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF'] ) ) {
 457          $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
 458      }
 459  
 460      $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );
 461      if ( $url != get_option( 'siteurl' ) ) {
 462          update_option( 'siteurl', $url );
 463      }
 464  }
 465  
 466  //Set a cookie now to see if they are supported by the browser.
 467  $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) );
 468  setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
 469  if ( SITECOOKIEPATH != COOKIEPATH ) {
 470      setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
 471  }
 472  
 473  /**
 474   * Fires when the login form is initialized.
 475   *
 476   * @since 3.2.0
 477   */
 478  do_action( 'login_init' );
 479  
 480  /**
 481   * Fires before a specified login form action.
 482   *
 483   * The dynamic portion of the hook name, `$action`, refers to the action
 484   * that brought the visitor to the login form. Actions include 'postpass',
 485   * 'logout', 'lostpassword', etc.
 486   *
 487   * @since 2.8.0
 488   */
 489  do_action( "login_form_{$action}" );
 490  
 491  $http_post     = ( 'POST' == $_SERVER['REQUEST_METHOD'] );
 492  $interim_login = isset( $_REQUEST['interim-login'] );
 493  
 494  /**
 495   * Filters the separator used between login form navigation links.
 496   *
 497   * @since 4.9.0
 498   *
 499   * @param string $login_link_separator The separator used between login form navigation links.
 500   */
 501  $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
 502  
 503  switch ( $action ) {
 504  
 505      case 'postpass':
 506          if ( ! array_key_exists( 'post_password', $_POST ) ) {
 507              wp_safe_redirect( wp_get_referer() );
 508              exit();
 509          }
 510  
 511          require_once  ABSPATH . WPINC . '/class-phpass.php';
 512          $hasher = new PasswordHash( 8, true );
 513  
 514          /**
 515           * Filters the life span of the post password cookie.
 516           *
 517           * By default, the cookie expires 10 days from creation. To turn this
 518           * into a session cookie, return 0.
 519           *
 520           * @since 3.7.0
 521           *
 522           * @param int $expires The expiry time, as passed to setcookie().
 523           */
 524          $expire  = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );
 525          $referer = wp_get_referer();
 526          if ( $referer ) {
 527              $secure = ( 'https' === parse_url( $referer, PHP_URL_SCHEME ) );
 528          } else {
 529              $secure = false;
 530          }
 531          setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
 532  
 533          wp_safe_redirect( wp_get_referer() );
 534          exit();
 535  
 536      case 'logout':
 537          check_admin_referer( 'log-out' );
 538  
 539          $user = wp_get_current_user();
 540  
 541          wp_logout();
 542  
 543          if ( ! empty( $_REQUEST['redirect_to'] ) ) {
 544              $redirect_to = $requested_redirect_to = $_REQUEST['redirect_to'];
 545          } else {
 546              $redirect_to           = 'wp-login.php?loggedout=true';
 547              $requested_redirect_to = '';
 548          }
 549  
 550          /**
 551           * Filters the log out redirect URL.
 552           *
 553           * @since 4.2.0
 554           *
 555           * @param string  $redirect_to           The redirect destination URL.
 556           * @param string  $requested_redirect_to The requested redirect destination URL passed as a parameter.
 557           * @param WP_User $user                  The WP_User object for the user that's logging out.
 558           */
 559          $redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );
 560          wp_safe_redirect( $redirect_to );
 561          exit();
 562  
 563      case 'lostpassword':
 564      case 'retrievepassword':
 565          if ( $http_post ) {
 566              $errors = retrieve_password();
 567              if ( ! is_wp_error( $errors ) ) {
 568                  $redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
 569                  wp_safe_redirect( $redirect_to );
 570                  exit();
 571              }
 572          }
 573  
 574          if ( isset( $_GET['error'] ) ) {
 575              if ( 'invalidkey' == $_GET['error'] ) {
 576                  $errors->add( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new link below.' ) );
 577              } elseif ( 'expiredkey' == $_GET['error'] ) {
 578                  $errors->add( 'expiredkey', __( 'Your password reset link has expired. Please request a new link below.' ) );
 579              }
 580          }
 581  
 582          $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
 583          /**
 584           * Filters the URL redirected to after submitting the lostpassword/retrievepassword form.
 585           *
 586           * @since 3.0.0
 587           *
 588           * @param string $lostpassword_redirect The redirect destination URL.
 589           */
 590          $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect );
 591  
 592          /**
 593           * Fires before the lost password form.
 594           *
 595           * @since 1.5.1
 596           * @since 5.1.0 Added the `$errors` parameter.
 597           *
 598           * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
 599           *                         credentials. Note that the error object may not contain any errors.
 600           */
 601          do_action( 'lost_password', $errors );
 602  
 603          login_header( __( 'Lost Password' ), '<p class="message">' . __( 'Please enter your username or email address. You will receive a link to create a new password via email.' ) . '</p>', $errors );
 604  
 605          $user_login = '';
 606  
 607          if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
 608              $user_login = wp_unslash( $_POST['user_login'] );
 609          }
 610  
 611          ?>
 612  
 613      <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
 614      <p>
 615          <label for="user_login" ><?php _e( 'Username or Email Address' ); ?><br />
 616          <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label>
 617      </p>
 618          <?php
 619          /**
 620           * Fires inside the lostpassword form tags, before the hidden fields.
 621           *
 622           * @since 2.1.0
 623           */
 624          do_action( 'lostpassword_form' );
 625          ?>
 626          <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
 627          <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>
 628      </form>
 629  
 630      <p id="nav">
 631      <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
 632          <?php
 633          if ( get_option( 'users_can_register' ) ) :
 634              $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
 635  
 636              echo esc_html( $login_link_separator );
 637  
 638              /** This filter is documented in wp-includes/general-template.php */
 639              echo apply_filters( 'register', $registration_url );
 640      endif;
 641          ?>
 642      </p>
 643  
 644          <?php
 645          login_footer( 'user_login' );
 646  
 647          break;
 648  
 649      case 'resetpass':
 650      case 'rp':
 651          list( $rp_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );
 652          $rp_cookie       = 'wp-resetpass-' . COOKIEHASH;
 653          if ( isset( $_GET['key'] ) ) {
 654              $value = sprintf( '%s:%s', wp_unslash( $_GET['login'] ), wp_unslash( $_GET['key'] ) );
 655              setcookie( $rp_cookie, $value, 0, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
 656              wp_safe_redirect( remove_query_arg( array( 'key', 'login' ) ) );
 657              exit;
 658          }
 659  
 660          if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
 661              list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
 662              $user                      = check_password_reset_key( $rp_key, $rp_login );
 663              if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
 664                  $user = false;
 665              }
 666          } else {
 667              $user = false;
 668          }
 669  
 670          if ( ! $user || is_wp_error( $user ) ) {
 671              setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
 672              if ( $user && $user->get_error_code() === 'expired_key' ) {
 673                  wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) );
 674              } else {
 675                  wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) );
 676              }
 677              exit;
 678          }
 679  
 680          $errors = new WP_Error();
 681  
 682          if ( isset( $_POST['pass1'] ) && $_POST['pass1'] != $_POST['pass2'] ) {
 683              $errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) );
 684          }
 685  
 686          /**
 687           * Fires before the password reset procedure is validated.
 688           *
 689           * @since 3.5.0
 690           *
 691           * @param object           $errors WP Error object.
 692           * @param WP_User|WP_Error $user   WP_User object if the login and reset key match. WP_Error object otherwise.
 693           */
 694          do_action( 'validate_password_reset', $errors, $user );
 695  
 696          if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
 697              reset_password( $user, $_POST['pass1'] );
 698              setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
 699              login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>' );
 700              login_footer();
 701              exit;
 702          }
 703  
 704          wp_enqueue_script( 'utils' );
 705          wp_enqueue_script( 'user-profile' );
 706  
 707          login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below.' ) . '</p>', $errors );
 708  
 709          ?>
 710      <form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off">
 711      <input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
 712  
 713      <div class="user-pass1-wrap">
 714          <p>
 715              <label for="pass1"><?php _e( 'New password' ); ?></label>
 716          </p>
 717  
 718          <div class="wp-pwd">
 719              <div class="password-input-wrapper">
 720                  <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" />
 721                  <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js">
 722                      <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
 723                  </button>
 724              </div>
 725              <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
 726          </div>
 727          <div class="pw-weak">
 728              <label>
 729                  <input type="checkbox" name="pw_weak" class="pw-checkbox" />
 730                  <?php _e( 'Confirm use of weak password' ); ?>
 731              </label>
 732          </div>
 733      </div>
 734  
 735      <p class="user-pass2-wrap">
 736          <label for="pass2"><?php _e( 'Confirm new password' ); ?></label><br />
 737          <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
 738      </p>
 739  
 740      <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
 741      <br class="clear" />
 742  
 743          <?php
 744          /**
 745           * Fires following the 'Strength indicator' meter in the user password reset form.
 746           *
 747           * @since 3.9.0
 748           *
 749           * @param WP_User $user User object of the user whose password is being reset.
 750           */
 751          do_action( 'resetpass_form', $user );
 752          ?>
 753      <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
 754      <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>
 755      </form>
 756  
 757      <p id="nav">
 758      <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
 759          <?php
 760          if ( get_option( 'users_can_register' ) ) :
 761              $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
 762  
 763              echo esc_html( $login_link_separator );
 764  
 765              /** This filter is documented in wp-includes/general-template.php */
 766              echo apply_filters( 'register', $registration_url );
 767      endif;
 768          ?>
 769      </p>
 770  
 771          <?php
 772          login_footer( 'user_pass' );
 773  
 774          break;
 775  
 776      case 'register':
 777          if ( is_multisite() ) {
 778              /**
 779               * Filters the Multisite sign up URL.
 780               *
 781               * @since 3.0.0
 782               *
 783               * @param string $sign_up_url The sign up URL.
 784               */
 785              wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );
 786              exit;
 787          }
 788  
 789          if ( ! get_option( 'users_can_register' ) ) {
 790              wp_redirect( site_url( 'wp-login.php?registration=disabled' ) );
 791              exit();
 792          }
 793  
 794          $user_login = '';
 795          $user_email = '';
 796  
 797          if ( $http_post ) {
 798              if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
 799                  $user_login = $_POST['user_login'];
 800              }
 801  
 802              if ( isset( $_POST['user_email'] ) && is_string( $_POST['user_email'] ) ) {
 803                  $user_email = wp_unslash( $_POST['user_email'] );
 804              }
 805  
 806              $errors = register_new_user( $user_login, $user_email );
 807              if ( ! is_wp_error( $errors ) ) {
 808                  $redirect_to = ! empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered';
 809                  wp_safe_redirect( $redirect_to );
 810                  exit();
 811              }
 812          }
 813  
 814          $registration_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
 815          /**
 816           * Filters the registration redirect URL.
 817           *
 818           * @since 3.0.0
 819           *
 820           * @param string $registration_redirect The redirect destination URL.
 821           */
 822          $redirect_to = apply_filters( 'registration_redirect', $registration_redirect );
 823          login_header( __( 'Registration Form' ), '<p class="message register">' . __( 'Register For This Site' ) . '</p>', $errors );
 824          ?>
 825      <form name="registerform" id="registerform" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post" novalidate="novalidate">
 826      <p>
 827          <label for="user_login"><?php _e( 'Username' ); ?><br />
 828          <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>
 829      </p>
 830      <p>
 831          <label for="user_email"><?php _e( 'Email' ); ?><br />
 832          <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
 833      </p>
 834          <?php
 835          /**
 836           * Fires following the 'Email' field in the user registration form.
 837           *
 838           * @since 2.1.0
 839           */
 840          do_action( 'register_form' );
 841          ?>
 842      <p id="reg_passmail"><?php _e( 'Registration confirmation will be emailed to you.' ); ?></p>
 843      <br class="clear" />
 844      <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
 845      <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>
 846      </form>
 847  
 848      <p id="nav">
 849      <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
 850          <?php echo esc_html( $login_link_separator ); ?>
 851      <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
 852      </p>
 853  
 854          <?php
 855          login_footer( 'user_login' );
 856  
 857          break;
 858  
 859      case 'confirmaction':
 860          if ( ! isset( $_GET['request_id'] ) ) {
 861              wp_die( __( 'Missing request ID.' ) );
 862          }
 863  
 864          if ( ! isset( $_GET['confirm_key'] ) ) {
 865              wp_die( __( 'Missing confirm key.' ) );
 866          }
 867  
 868          $request_id = (int) $_GET['request_id'];
 869          $key        = sanitize_text_field( wp_unslash( $_GET['confirm_key'] ) );
 870          $result     = wp_validate_user_request_key( $request_id, $key );
 871  
 872          if ( is_wp_error( $result ) ) {
 873              wp_die( $result );
 874          }
 875  
 876          /**
 877           * Fires an action hook when the account action has been confirmed by the user.
 878           *
 879           * Using this you can assume the user has agreed to perform the action by
 880           * clicking on the link in the confirmation email.
 881           *
 882           * After firing this action hook the page will redirect to wp-login a callback
 883           * redirects or exits first.
 884           *
 885           * @since 4.9.6
 886           *
 887           * @param int $request_id Request ID.
 888           */
 889          do_action( 'user_request_action_confirmed', $request_id );
 890  
 891          $message = _wp_privacy_account_request_confirmed_message( $request_id );
 892  
 893          login_header( __( 'User action confirmed.' ), $message );
 894          login_footer();
 895          exit;
 896  
 897      case 'login':
 898      default:
 899          $secure_cookie   = '';
 900          $customize_login = isset( $_REQUEST['customize-login'] );
 901          if ( $customize_login ) {
 902              wp_enqueue_script( 'customize-base' );
 903          }
 904  
 905          // If the user wants SSL but the session is not SSL, force a secure cookie.
 906          if ( ! empty( $_POST['log'] ) && ! force_ssl_admin() ) {
 907              $user_name = sanitize_user( $_POST['log'] );
 908              $user      = get_user_by( 'login', $user_name );
 909  
 910              if ( ! $user && strpos( $user_name, '@' ) ) {
 911                  $user = get_user_by( 'email', $user_name );
 912              }
 913  
 914              if ( $user ) {
 915                  if ( get_user_option( 'use_ssl', $user->ID ) ) {
 916                      $secure_cookie = true;
 917                      force_ssl_admin( true );
 918                  }
 919              }
 920          }
 921  
 922          if ( isset( $_REQUEST['redirect_to'] ) ) {
 923              $redirect_to = $_REQUEST['redirect_to'];
 924              // Redirect to HTTPS if user wants SSL.
 925              if ( $secure_cookie && false !== strpos( $redirect_to, 'wp-admin' ) ) {
 926                  $redirect_to = preg_replace( '|^http://|', 'https://', $redirect_to );
 927              }
 928          } else {
 929              $redirect_to = admin_url();
 930          }
 931  
 932          $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
 933  
 934          $user = wp_signon( array(), $secure_cookie );
 935  
 936          if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
 937              if ( headers_sent() ) {
 938                  $user = new WP_Error(
 939                      'test_cookie',
 940                      sprintf(
 941                          /* translators: 1: Browser cookie documentation URL, 2: Support forums URL */
 942                          __( '<strong>ERROR</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ),
 943                          __( 'https://wordpress.org/support/article/cookies/' ),
 944                          __( 'https://wordpress.org/support/' )
 945                      )
 946                  );
 947              } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
 948                  // If cookies are disabled we can't log in even with a valid user+pass
 949                  $user = new WP_Error(
 950                      'test_cookie',
 951                      sprintf(
 952                          /* translators: %s: Browser cookie documentation URL */
 953                          __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ),
 954                          __( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )
 955                      )
 956                  );
 957              }
 958          }
 959  
 960          $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
 961          /**
 962           * Filters the login redirect URL.
 963           *
 964           * @since 3.0.0
 965           *
 966           * @param string           $redirect_to           The redirect destination URL.
 967           * @param string           $requested_redirect_to The requested redirect destination URL passed as a parameter.
 968           * @param WP_User|WP_Error $user                  WP_User object if login was successful, WP_Error object otherwise.
 969           */
 970          $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user );
 971  
 972          if ( ! is_wp_error( $user ) && ! $reauth ) {
 973              if ( $interim_login ) {
 974                  $message       = '<p class="message">' . __( 'You have logged in successfully.' ) . '</p>';
 975                  $interim_login = 'success';
 976                  login_header( '', $message );
 977                  ?>
 978                  </div>
 979                  <?php
 980                  /** This action is documented in wp-login.php */
 981                  do_action( 'login_footer' );
 982                  ?>
 983                  <?php if ( $customize_login ) : ?>
 984                  <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
 985              <?php endif; ?>
 986                  </body></html>
 987                  <?php
 988                  exit;
 989              }
 990  
 991              if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
 992                  // 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.
 993                  if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
 994                      $redirect_to = user_admin_url();
 995                  } elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) {
 996                      $redirect_to = get_dashboard_url( $user->ID );
 997                  } elseif ( ! $user->has_cap( 'edit_posts' ) ) {
 998                      $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url();
 999                  }
1000  
1001                  wp_redirect( $redirect_to );
1002                  exit();
1003              }
1004              wp_safe_redirect( $redirect_to );
1005              exit();
1006          }
1007  
1008          $errors = $user;
1009          // Clear errors if loggedout is set.
1010          if ( ! empty( $_GET['loggedout'] ) || $reauth ) {
1011              $errors = new WP_Error();
1012          }
1013  
1014          if ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) {
1015              $errors = new WP_Error( '', '' );
1016          }
1017  
1018          if ( $interim_login ) {
1019              if ( ! $errors->has_errors() ) {
1020                  $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );
1021              }
1022          } else {
1023              // Some parts of this script use the main login form to display a message.
1024              if ( isset( $_GET['loggedout'] ) && true == $_GET['loggedout'] ) {
1025                  $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' );
1026              } elseif ( isset( $_GET['registration'] ) && 'disabled' == $_GET['registration'] ) {
1027                  $errors->add( 'registerdisabled', __( 'User registration is currently not allowed.' ) );
1028              } elseif ( isset( $_GET['checkemail'] ) && 'confirm' == $_GET['checkemail'] ) {
1029                  $errors->add( 'confirm', __( 'Check your email for the confirmation link.' ), 'message' );
1030              } elseif ( isset( $_GET['checkemail'] ) && 'newpass' == $_GET['checkemail'] ) {
1031                  $errors->add( 'newpass', __( 'Check your email for your new password.' ), 'message' );
1032              } elseif ( isset( $_GET['checkemail'] ) && 'registered' == $_GET['checkemail'] ) {
1033                  $errors->add( 'registered', __( 'Registration complete. Please check your email.' ), 'message' );
1034              } elseif ( strpos( $redirect_to, 'about.php?updated' ) ) {
1035                  $errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what&#8217;s new.' ), 'message' );
1036              } elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) {
1037                  $errors->add( 'enter_recovery_mode', __( 'Recovery Mode Initialized. Please log in to continue.' ), 'message' );
1038              }
1039          }
1040  
1041          /**
1042           * Filters the login page errors.
1043           *
1044           * @since 3.6.0
1045           *
1046           * @param object $errors      WP Error object.
1047           * @param string $redirect_to Redirect destination URL.
1048           */
1049          $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
1050  
1051          // Clear any stale cookies.
1052          if ( $reauth ) {
1053              wp_clear_auth_cookie();
1054          }
1055  
1056          login_header( __( 'Log In' ), '', $errors );
1057  
1058          if ( isset( $_POST['log'] ) ) {
1059              $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr( wp_unslash( $_POST['log'] ) ) : '';
1060          }
1061          $rememberme = ! empty( $_POST['rememberme'] );
1062  
1063          if ( $errors->has_errors() ) {
1064              $aria_describedby_error = ' aria-describedby="login_error"';
1065          } else {
1066              $aria_describedby_error = '';
1067          }
1068          ?>
1069  
1070      <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
1071      <p>
1072          <label for="user_login"><?php _e( 'Username or Email Address' ); ?><br />
1073          <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>
1074      </p>
1075      <p>
1076          <label for="user_pass"><?php _e( 'Password' ); ?><br />
1077          <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>
1078      </p>
1079          <?php
1080          /**
1081           * Fires following the 'Password' field in the login form.
1082           *
1083           * @since 2.1.0
1084           */
1085          do_action( 'login_form' );
1086          ?>
1087      <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>
1088      <p class="submit">
1089          <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" />
1090          <?php    if ( $interim_login ) { ?>
1091          <input type="hidden" name="interim-login" value="1" />
1092      <?php    } else { ?>
1093          <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
1094      <?php } ?>
1095          <?php if ( $customize_login ) : ?>
1096          <input type="hidden" name="customize-login" value="1" />
1097      <?php endif; ?>
1098          <input type="hidden" name="testcookie" value="1" />
1099      </p>
1100      </form>
1101  
1102          <?php if ( ! $interim_login ) { ?>
1103      <p id="nav">
1104              <?php
1105              if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
1106                  if ( get_option( 'users_can_register' ) ) :
1107                      $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
1108  
1109                      /** This filter is documented in wp-includes/general-template.php */
1110                      echo apply_filters( 'register', $registration_url );
1111  
1112                      echo esc_html( $login_link_separator );
1113                  endif;
1114                  ?>
1115          <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
1116              <?php endif; ?>
1117      </p>
1118      <?php } ?>
1119  
1120      <script type="text/javascript">
1121  	function wp_attempt_focus(){
1122      setTimeout( function(){ try{
1123          <?php if ( $user_login ) { ?>
1124      d = document.getElementById('user_pass');
1125      d.value = '';
1126      <?php } else { ?>
1127      d = document.getElementById('user_login');
1128              <?php if ( 'invalid_username' == $errors->get_error_code() ) { ?>
1129      if( d.value != '' )
1130      d.value = '';
1131                  <?php
1132              }
1133      }
1134      ?>
1135      d.focus();
1136      d.select();
1137      } catch(e){}
1138      }, 200);
1139      }
1140  
1141          <?php
1142          /**
1143           * Filters whether to print the call to `wp_attempt_focus()` on the login screen.
1144           *
1145           * @since 4.8.0
1146           *
1147           * @param bool $print Whether to print the function call. Default true.
1148           */
1149          if ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) {
1150              ?>
1151      wp_attempt_focus();
1152          <?php } ?>
1153      if(typeof wpOnload=='function')wpOnload();
1154          <?php if ( $interim_login ) { ?>
1155      (function(){
1156      try {
1157          var i, links = document.getElementsByTagName('a');
1158          for ( i in links ) {
1159              if ( links[i].href )
1160                  links[i].target = '_blank';
1161          }
1162      } catch(e){}
1163      }());
1164      <?php } ?>
1165      </script>
1166  
1167          <?php
1168          login_footer();
1169  
1170          break;
1171  } // End action switch.


Generated: Sun Apr 21 01:00:05 2019 Cross-referenced by PHPXref 0.7.1