--- wp-login.php	2013-07-23 07:27:56.000000000 +0900
+++ wp-login_new_1733.php	2013-09-23 08:31:18.000000000 +0900
@@ -49,6 +49,13 @@
 
 	// Shake it!
 	$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
+	/**
+	 * Filter the error codes array that are to shake the login form.
+	 *
+	 * @since 3.0.0
+	 *
+	 * @param array $shake_error_codes Error codes that will shake the login form.
+	 */
 	$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
 
 	if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
@@ -77,7 +84,19 @@
 		<?php
 	}
 
+	/**
+	 * Fires at the timig of enqueing scripts and styles on the login page.
+	 *
+	 * The proper hook to use when enqueuing scripts and styles that are meant to appear on the login page.
+	 *
+	 * @since 3.1.0
+	 */
 	do_action( 'login_enqueue_scripts' );
+	/**
+	 * Fires before </head> on the login page.
+	 *
+	 * @since 2.1.0
+	 */	
 	do_action( 'login_head' );
 
 	if ( is_multisite() ) {
@@ -87,8 +106,21 @@
 		$login_header_url   = __( 'http://wordpress.org/' );
 		$login_header_title = __( 'Powered by WordPress' );
 	}
-
+	/**
+	 * Filter the link url of the header logo above login form.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $login_header_url Default url.
+	 */
 	$login_header_url   = apply_filters( 'login_headerurl',   $login_header_url   );
+	/**
+	 * Filter the title of the header logo above login form.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $login_header_title Default title.
+	 */
 	$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
 
 	$classes = array( 'login-action-' . $action, 'wp-core-ui' );
@@ -105,7 +137,14 @@
 		if ( 'success' ===  $interim_login )
 			$classes[] = 'interim-login-success';
 	}
-
+	/**
+	 * Filter the classes of login page <body>.
+	 *
+	 * @since 3.5.0
+	 *
+	 * @param array $classes Classes to be added to the <body>.
+	 * @param string $action The action user took before coming to the login page.
+	 */
 	$classes = apply_filters( 'login_body_class', $classes, $action );
 
 	?>
@@ -116,8 +155,14 @@
 	<?php
 
 	unset( $login_header_url, $login_header_title );
-
-	$message = apply_filters('login_message', $message);
+	/**
+	 * Filter the message to display in header above login form.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $message Message text.
+	 */
+	$message = apply_filters( 'login_message', $message );
 	if ( !empty( $message ) )
 		echo $message . "\n";
 
@@ -140,9 +185,23 @@
 			}
 		}
 		if ( !empty($errors) )
-			echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
+			/**
+			 * Filter the error message above the login form.
+			 *
+			 * @since 2.1.0
+			 *
+			 * @param string $errors Error message.
+			 */
+			echo '<div id="login_error">' . apply_filters( 'login_errors', $errors ) . "</div>\n";
 		if ( !empty($messages) )
-			echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
+			/**
+			 * Filter the message above the login form.
+			 *
+			 * @since 2.5.0
+			 *
+			 * @param string $messages Login message.
+			 */
+			echo '<p class="message">' . apply_filters( 'login_messages', $messages ) . "</p>\n";
 	}
 } // End of login_header()
 
@@ -168,7 +227,13 @@
 	</script>
 	<?php endif; ?>
 
-	<?php do_action('login_footer'); ?>
+	<?php
+	/**
+	 * Fires at the end of the html on the login page.
+	 *
+	 * @since 3.1.0
+	 */	
+	do_action( 'login_footer' ); ?>
 	<div class="clear"></div>
 	</body>
 	</html>
@@ -212,7 +277,12 @@
 		$user_data = get_user_by('login', $login);
 	}
 
-	do_action('lostpassword_post');
+	/**
+	 * Fires before returning WP Error in password retrieving process.
+	 *
+	 * @since 2.1.0
+	 */	
+	do_action( 'lostpassword_post' );
 
 	if ( $errors->get_error_code() )
 		return $errors;
@@ -226,10 +296,25 @@
 	$user_login = $user_data->user_login;
 	$user_email = $user_data->user_email;
 
-	do_action('retreive_password', $user_login);  // Misspelled and deprecated
+	// Misspelled and deprecated
+	do_action( 'retreive_password', $user_login );
+	/**
+	 * Fires after redefing user login from the user data object.
+	 *
+	 * @since 1.5.2
+	 *
+	 * @param string $user_login User name to login.
+	 */		
 	do_action('retrieve_password', $user_login);
-
-	$allow = apply_filters('allow_password_reset', true, $user_data->ID);
+	/**
+	 * Filter password reset restriction boolean.
+	 *
+	 * @since 2.7.0
+	 *
+	 * @param boolean True as default.
+	 * @param int $user_data->ID The ID of the user who is retrieving new password.
+	 */
+	$allow = apply_filters( 'allow_password_reset', true, $user_data->ID );
 
 	if ( ! $allow )
 		return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
@@ -240,7 +325,15 @@
 	if ( empty($key) ) {
 		// Generate something random for a key...
 		$key = wp_generate_password(20, false);
-		do_action('retrieve_password_key', $user_login, $key);
+		/**
+		 * Fires before inserting the new md5 key into database.
+		 *
+		 * @since 2.5.0
+		 *
+		 * @param string $user_login User name to login.
+		 * @param string $key Activation key.
+		 */ 
+		do_action( 'retrieve_password_key', $user_login, $key );
 		// Now insert the new md5 key into the db
 		$wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
 	}
@@ -259,9 +352,23 @@
 		$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
 
 	$title = sprintf( __('[%s] Password Reset'), $blogname );
-
-	$title = apply_filters('retrieve_password_title', $title);
-	$message = apply_filters('retrieve_password_message', $message, $key);
+	/**
+	 * Filter the title of the password reset mail.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @param string $title Default mail title.
+	 */
+	$title = apply_filters( 'retrieve_password_title', $title );
+	/**
+	 * Filter the body message of the password reset mail.
+	 *
+	 * @since 2.8.0
+	 *
+	 * @param string $message Default mail message.
+	 * @param string $key The activation key.
+	 */
+	$message = apply_filters( 'retrieve_password_message', $message, $key );
 
 	if ( $message && !wp_mail($user_email, $title, $message) )
 		wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );
@@ -304,7 +411,15 @@
  * @param string $new_pass New password for the user in plaintext
  */
 function reset_password($user, $new_pass) {
-	do_action('password_reset', $user, $new_pass);
+	/**
+	 * Runs before the user's password is reset to a random new password.
+	 *
+	 * @since 1.5.2
+	 *
+	 * @param string $user The user.
+	 * @param string $new_pass New password for the user in plaintext.
+	 */		
+	do_action( 'password_reset', $user, $new_pass );
 
 	wp_set_password($new_pass, $user->ID);
 
@@ -322,6 +437,13 @@
 	$errors = new WP_Error();
 
 	$sanitized_user_login = sanitize_user( $user_login );
+	/**
+	 * Filter the user email address on user registration.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $user_email User's email address to send password and add.
+	 */
 	$user_email = apply_filters( 'user_registration_email', $user_email );
 
 	// Check the username
@@ -344,8 +466,25 @@
 		$errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
 	}
 
+	/**
+	 * Fires before registering a new user.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param string $sanitized_user_login Sanitized user's username for logging in.
+	 * @param string $user_email New user email.
+	 * @param object $errors WP Error object.
+	 */		
 	do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
-
+	/**
+	 * Filter the errors of register validation.
+	 *
+	 * @since 2.1.0
+	 *
+	 * @param array $errors WP Error object.
+	 * @param string $sanitized_user_login Sanitized user's username for logging in.
+	 * @param string $user_email New user email.
+	 */
 	$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
 
 	if ( $errors->get_error_code() )
@@ -397,8 +536,21 @@
 if ( SITECOOKIEPATH != COOKIEPATH )
 	setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
 
-// allow plugins to override the default actions, and to add extra actions if they want
+/**
+ * Fires before running the main action of wp-login.php.
+ * 
+ * Allow plugins to override the default actions, and to add extra actions if they want.
+ *
+ * @since 3.2.0
+ *
+ */		
 do_action( 'login_init' );
+/**
+ * Fires before running the main action of wp-login.php depending on the $action.
+ * 
+ * @since Unknown
+ *
+ */		
 do_action( 'login_form_' . $action );
 
 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
@@ -441,9 +593,22 @@
 	}
 
 	if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.'));
+	/**
+	 * Filtering the redirect url after submitting the lostpassword/retrievepassword form.
+	 *
+	 * @since 3.0.0
+	 *
+	 * @param string The redirect destination url.
+	 */
 	$redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
 
-	do_action('lost_password');
+	/**
+	 * Fires before the lost password and retrieving password form
+	 *
+	 * @since 1.5.2
+	 *
+	 */	
+	do_action( 'lost_password' );
 	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);
 
 	$user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : '';
@@ -455,17 +620,32 @@
 		<label for="user_login" ><?php _e('Username or E-mail:') ?><br />
 		<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>
 	</p>
-<?php do_action('lostpassword_form'); ?>
+<?php
+/**
+ * Fires in the lostpassword form.
+ * 
+ * @since 2.1.0
+ *
+ */		
+do_action( 'lostpassword_form' ); ?>
 	<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
 	<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>
 </form>
 
 <p id="nav">
 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a>
-<?php if ( get_option( 'users_can_register' ) ) : ?>
- | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
-<?php endif; ?>
-</p>
+<?php
+	if ( get_option( 'users_can_register' ) ) :
+		/**
+		 * Filter the Register link text below the login form.
+		 *
+		 * @since 1.5.2
+		 *
+		 * @param string Register ink text.
+		 */
+		echo ' | ' . apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) );
+	endif;
+?></p>
 
 <?php
 login_footer('user_login');
@@ -485,6 +665,14 @@
 	if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] )
 		$errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) );
 
+	/**
+	 * Fires before the validation in the reset password precedure.
+	 * 
+	 * @since 3.5.0
+	 *
+	 * @param object $errors WP Error object.
+	 * @param string $user User data.
+	 */	
 	do_action( 'validate_password_reset', $errors, $user );
 
 	if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) {
@@ -521,10 +709,13 @@
 
 <p id="nav">
 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
-<?php if ( get_option( 'users_can_register' ) ) : ?>
- | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
-<?php endif; ?>
-</p>
+<?php
+	if ( get_option( 'users_can_register' ) ) :
+		//duplicate_hook
+		echo ' | ' . apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) );
+	endif;
+?></p>
+
 
 <?php
 login_footer('user_pass');
@@ -532,7 +723,13 @@
 
 case 'register' :
 	if ( is_multisite() ) {
-		// Multisite uses wp-signup.php
+		/**
+		 * Filter the redirect destination url for the Multi Site installation.
+		 *
+		 * @since 3.0.0
+		 *
+		 * @param string Signup url of the multisite.
+		 */
 		wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) );
 		exit;
 	}
@@ -554,7 +751,13 @@
 			exit();
 		}
 	}
-
+	/**
+	 * Filter the redirect destination url after user registration.
+	 *
+	 * @since 3.0.0
+	 *
+	 * @param string The redirect destination url.
+	 */
 	$redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
 	login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
 ?>
@@ -568,7 +771,14 @@
 		<label for="user_email"><?php _e('E-mail') ?><br />
 		<input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label>
 	</p>
-<?php do_action('register_form'); ?>
+<?php
+/**
+ * Fires in the registration form.
+ * 
+ * @since 2.1.0
+ *
+ */	
+do_action( 'register_form' ); ?>
 	<p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
 	<br class="clear" />
 	<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
@@ -621,7 +831,16 @@
 
 	$user = wp_signon('', $secure_cookie);
 
-	$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
+	/**
+	 * Filtering the redirect url after login.
+	 *
+	 * @since 3.0.0
+	 *
+	 * @param string $redirect_to The redirect destination url.
+	 * @param string The redirect destination url which was passed as a parameter.
+	 * @param object $user User data object. 
+	 */
+	$redirect_to = apply_filters( 'login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user );
 
 	if ( !is_wp_error($user) && !$reauth ) {
 		if ( $interim_login ) {
@@ -629,7 +848,16 @@
 			$interim_login = 'success';
 			login_header( '', $message ); ?>
 			</div>
-			<?php do_action( 'login_footer' ); ?>
+			<?php
+			/**
+			 * Fires at the end of the html on the login page.
+			 * 
+			 * @since 3.5.0
+			 *
+			 * @param object $errors WP Error object.
+			 * @param string $user User data.
+			 */	
+			do_action( 'login_footer' ); ?>
 			<?php if ( $customize_login ) : ?>
 				<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
 			<?php endif; ?>
@@ -677,7 +905,14 @@
 		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' );
 	}
-
+	/**
+	 * Filter the WP Error object.
+	 *
+	 * @since 3.6.0
+	 *
+	 * @param object $errors WP Error object.
+	 * @param string $redirect_to Redirect destination url.
+	 */
 	$errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
 
 	// Clear any stale cookies.
@@ -700,7 +935,14 @@
 		<label for="user_pass"><?php _e('Password') ?><br />
 		<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
 	</p>
-<?php do_action('login_form'); ?>
+<?php
+/**
+ * Fires in the login form.
+ * 
+ * @since 2.1.0
+ *
+ */	
+do_action( 'login_form' ); ?>
 	<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <?php esc_attr_e('Remember Me'); ?></label></p>
 	<p class="submit">
 		<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Log In'); ?>" />
@@ -718,10 +960,12 @@
 
 <?php if ( ! $interim_login ) { ?>
 <p id="nav">
-<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?>
-	<?php if ( get_option( 'users_can_register' ) ) : ?>
-		<?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> |
-	<?php endif; ?>
+<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) :
+	if ( get_option( 'users_can_register' ) ) :
+		//duplicate_hook
+		echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ) . ' | ';
+	endif;
+?>
 	<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
 <?php endif; ?>
 </p>
