Changeset 43571 for trunk/src/wp-login.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-login.php
r43569 r43571 255 255 // Don't allow interim logins to navigate away from the page. 256 256 if ( ! $interim_login ) : 257 ?>257 ?> 258 258 <p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"> 259 <?php259 <?php 260 260 /* translators: %s: site title */ 261 261 printf( _x( '← Back to %s', 'site' ), get_bloginfo( 'title', 'display' ) ); 262 ?>262 ?> 263 263 </a></p> 264 <?php the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' ); ?>264 <?php the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' ); ?> 265 265 <?php endif; ?> 266 266 … … 292 292 */ 293 293 function wp_shake_js() { 294 ?>294 ?> 295 295 <script type="text/javascript"> 296 296 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();}}}; … … 300 300 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);}); 301 301 </script> 302 <?php302 <?php 303 303 } 304 304 … … 604 604 } 605 605 606 ?>606 ?> 607 607 608 608 <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post"> … … 611 611 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" /></label> 612 612 </p> 613 <?php614 /**615 * Fires inside the lostpassword form tags, before the hidden fields.616 *617 * @since 2.1.0618 */619 do_action( 'lostpassword_form' );620 ?>613 <?php 614 /** 615 * Fires inside the lostpassword form tags, before the hidden fields. 616 * 617 * @since 2.1.0 618 */ 619 do_action( 'lostpassword_form' ); 620 ?> 621 621 <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> 622 622 <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> … … 625 625 <p id="nav"> 626 626 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> 627 <?php628 if ( get_option( 'users_can_register' ) ) :629 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );630 631 echo esc_html( $login_link_separator );632 633 /** This filter is documented in wp-includes/general-template.php */634 echo apply_filters( 'register', $registration_url );627 <?php 628 if ( get_option( 'users_can_register' ) ) : 629 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); 630 631 echo esc_html( $login_link_separator ); 632 633 /** This filter is documented in wp-includes/general-template.php */ 634 echo apply_filters( 'register', $registration_url ); 635 635 endif; 636 ?>636 ?> 637 637 </p> 638 638 639 <?php640 login_footer( 'user_login' );641 642 if ( $switched_locale ) {643 restore_previous_locale();644 }639 <?php 640 login_footer( 'user_login' ); 641 642 if ( $switched_locale ) { 643 restore_previous_locale(); 644 } 645 645 646 646 break; … … 706 706 login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below.' ) . '</p>', $errors ); 707 707 708 ?>708 ?> 709 709 <form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off"> 710 710 <input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" /> … … 740 740 <br class="clear" /> 741 741 742 <?php743 /**744 * Fires following the 'Strength indicator' meter in the user password reset form.745 *746 * @since 3.9.0747 *748 * @param WP_User $user User object of the user whose password is being reset.749 */750 do_action( 'resetpass_form', $user );751 ?>742 <?php 743 /** 744 * Fires following the 'Strength indicator' meter in the user password reset form. 745 * 746 * @since 3.9.0 747 * 748 * @param WP_User $user User object of the user whose password is being reset. 749 */ 750 do_action( 'resetpass_form', $user ); 751 ?> 752 752 <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" /> 753 753 <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> … … 756 756 <p id="nav"> 757 757 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> 758 <?php759 if ( get_option( 'users_can_register' ) ) :760 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );761 762 echo esc_html( $login_link_separator );763 764 /** This filter is documented in wp-includes/general-template.php */765 echo apply_filters( 'register', $registration_url );758 <?php 759 if ( get_option( 'users_can_register' ) ) : 760 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ); 761 762 echo esc_html( $login_link_separator ); 763 764 /** This filter is documented in wp-includes/general-template.php */ 765 echo apply_filters( 'register', $registration_url ); 766 766 endif; 767 ?>767 ?> 768 768 </p> 769 769 770 <?php771 login_footer( 'user_pass' );772 773 if ( $switched_locale ) {774 restore_previous_locale();775 }770 <?php 771 login_footer( 'user_pass' ); 772 773 if ( $switched_locale ) { 774 restore_previous_locale(); 775 } 776 776 777 777 break; … … 825 825 $redirect_to = apply_filters( 'registration_redirect', $registration_redirect ); 826 826 login_header( __( 'Registration Form' ), '<p class="message register">' . __( 'Register For This Site' ) . '</p>', $errors ); 827 ?>827 ?> 828 828 <form name="registerform" id="registerform" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post" novalidate="novalidate"> 829 829 <p> … … 835 835 <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label> 836 836 </p> 837 <?php838 /**839 * Fires following the 'Email' field in the user registration form.840 *841 * @since 2.1.0842 */843 do_action( 'register_form' );844 ?>837 <?php 838 /** 839 * Fires following the 'Email' field in the user registration form. 840 * 841 * @since 2.1.0 842 */ 843 do_action( 'register_form' ); 844 ?> 845 845 <p id="reg_passmail"><?php _e( 'Registration confirmation will be emailed to you.' ); ?></p> 846 846 <br class="clear" /> … … 851 851 <p id="nav"> 852 852 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> 853 <?php echo esc_html( $login_link_separator ); ?>853 <?php echo esc_html( $login_link_separator ); ?> 854 854 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a> 855 855 </p> 856 856 857 <?php858 login_footer( 'user_login' );859 860 if ( $switched_locale ) {861 restore_previous_locale();862 }857 <?php 858 login_footer( 'user_login' ); 859 860 if ( $switched_locale ) { 861 restore_previous_locale(); 862 } 863 863 864 864 break; 865 865 866 case 'confirmaction' 866 case 'confirmaction': 867 867 if ( ! isset( $_GET['request_id'] ) ) { 868 868 wp_die( __( 'Invalid request.' ) ); … … 944 944 /* translators: 1: Browser cookie documentation URL, 2: Support forums URL */ 945 945 $user = new WP_Error( 946 'test_cookie', sprintf( 946 'test_cookie', 947 sprintf( 947 948 __( '<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>.' ), 948 __( 'https://codex.wordpress.org/Cookies' ), __( 'https://wordpress.org/support/' ) 949 __( 'https://codex.wordpress.org/Cookies' ), 950 __( 'https://wordpress.org/support/' ) 949 951 ) 950 952 ); … … 953 955 /* translators: %s: Browser cookie documentation URL */ 954 956 $user = new WP_Error( 955 'test_cookie', sprintf( 957 'test_cookie', 958 sprintf( 956 959 __( '<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ), 957 960 __( 'https://codex.wordpress.org/Cookies' ) … … 978 981 $interim_login = 'success'; 979 982 login_header( '', $message ); 980 ?>983 ?> 981 984 </div> 982 985 <?php 983 986 /** This action is documented in wp-login.php */ 984 987 do_action( 'login_footer' ); 985 ?>988 ?> 986 989 <?php if ( $customize_login ) : ?> 987 990 <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script> 988 991 <?php endif; ?> 989 992 </body></html> 990 <?php991 993 <?php 994 exit; 992 995 } 993 996 … … 1063 1066 $aria_describedby_error = ''; 1064 1067 } 1065 ?>1068 ?> 1066 1069 1067 1070 <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"> … … 1074 1077 <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label> 1075 1078 </p> 1076 <?php1077 /**1078 * Fires following the 'Password' field in the login form.1079 *1080 * @since 2.1.01081 */1082 do_action( 'login_form' );1083 ?>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 ?> 1084 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> 1085 1088 <p class="submit"> 1086 1089 <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" /> 1087 <?php if ( $interim_login ) { ?>1090 <?php if ( $interim_login ) { ?> 1088 1091 <input type="hidden" name="interim-login" value="1" /> 1089 1092 <?php } else { ?> 1090 1093 <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> 1091 1094 <?php } ?> 1092 <?php if ( $customize_login ) : ?>1095 <?php if ( $customize_login ) : ?> 1093 1096 <input type="hidden" name="customize-login" value="1" /> 1094 1097 <?php endif; ?> … … 1097 1100 </form> 1098 1101 1099 <?php if ( ! $interim_login ) { ?>1102 <?php if ( ! $interim_login ) { ?> 1100 1103 <p id="nav"> 1101 <?php1102 if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :1103 if ( get_option( 'users_can_register' ) ) :1104 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );1105 1106 /** This filter is documented in wp-includes/general-template.php */1107 echo apply_filters( 'register', $registration_url );1108 1109 echo esc_html( $login_link_separator );1110 endif;1111 ?>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 ?> 1112 1115 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a> 1113 <?php endif; ?>1116 <?php endif; ?> 1114 1117 </p> 1115 1118 <?php } ?> … … 1118 1121 function wp_attempt_focus(){ 1119 1122 setTimeout( function(){ try{ 1120 <?php if ( $user_login ) { ?>1123 <?php if ( $user_login ) { ?> 1121 1124 d = document.getElementById('user_pass'); 1122 1125 d.value = ''; … … 1126 1129 if( d.value != '' ) 1127 1130 d.value = ''; 1128 <?php1131 <?php 1129 1132 } 1130 1133 } … … 1136 1139 } 1137 1140 1138 <?php1139 /**1140 * Filters whether to print the call to `wp_attempt_focus()` on the login screen.1141 *1142 * @since 4.8.01143 *1144 * @param bool $print Whether to print the function call. Default true.1145 */1146 if ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) {1147 ?>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 ?> 1148 1151 wp_attempt_focus(); 1149 <?php } ?>1152 <?php } ?> 1150 1153 if(typeof wpOnload=='function')wpOnload(); 1151 <?php if ( $interim_login ) { ?>1154 <?php if ( $interim_login ) { ?> 1152 1155 (function(){ 1153 1156 try { … … 1162 1165 </script> 1163 1166 1164 <?php1165 login_footer();1166 1167 if ( $switched_locale ) {1168 restore_previous_locale();1169 }1167 <?php 1168 login_footer(); 1169 1170 if ( $switched_locale ) { 1171 restore_previous_locale(); 1172 } 1170 1173 1171 1174 break;
Note: See TracChangeset
for help on using the changeset viewer.