diff --git a/wp-login.php b/wp-login.php
index 111eddc1cf..39526f822d 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -23,19 +23,11 @@ if ( force_ssl_admin() && ! is_ssl() ) {
}
/**
- * Outputs the header for the login page.
+ * Output the login page header.
*
- * @uses do_action() Calls the 'login_head' for outputting HTML in the Log In
- * header.
- * @uses apply_filters() Calls 'login_headerurl' for the top login link.
- * @uses apply_filters() Calls 'login_headertitle' for the top login title.
- * @uses apply_filters() Calls 'login_message' on the message to display in the
- * header.
- * @uses $error The error global, which is checked for displaying errors.
- *
- * @param string $title Optional. WordPress Log In Page title to display in
- *
element.
- * @param string $message Optional. Message to display in header.
+ * @param string $title Optional. WordPress Log In Page title to display in element. Default 'Log In'.
+ * @param string $message Optional. Message to display in header. Default empty.
+ * @param string $wp_error Optional. The error to pass. Default empty.
* @param WP_Error $wp_error Optional. WordPress Error Object
*/
function login_header($title = 'Log In', $message = '', $wp_error = '') {
@@ -52,6 +44,13 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
// Shake it!
$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
+ /**
+ * Filter the error codes array for shaking the login form.
+ *
+ * @since 3.0.0
+ *
+ * @param array $shake_error_codes Error codes that 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 ) )
@@ -76,7 +75,17 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
@@ -116,7 +147,14 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
unset( $login_header_url, $login_header_title );
- $message = apply_filters('login_message', $message);
+ /**
+ * Filter the message to display above the login form.
+ *
+ * @since 2.1.0
+ *
+ * @param string $message Login message text.
+ */
+ $message = apply_filters( 'login_message', $message );
if ( !empty( $message ) )
echo $message . "\n";
@@ -138,10 +176,26 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
$errors .= ' ' . $error . "
\n";
}
}
- if ( !empty($errors) )
- echo '' . apply_filters('login_errors', $errors) . "
\n";
- if ( !empty($messages) )
- echo '' . apply_filters('login_messages', $messages) . "
\n";
+ if ( ! empty( $errors ) ) {
+ /**
+ * Filter the error messages displayed above the login form.
+ *
+ * @since 2.1.0
+ *
+ * @param string $errors Login error message.
+ */
+ echo '' . apply_filters( 'login_errors', $errors ) . "
\n";
+ }
+ if ( ! empty( $messages ) ) {
+ /**
+ * Filter instructional messages displayed above the login form.
+ *
+ * @since 2.5.0
+ *
+ * @param string $messages Login messages.
+ */
+ echo '' . apply_filters( 'login_messages', $messages ) . "
\n";
+ }
}
} // End of login_header()
@@ -167,7 +221,13 @@ function login_footer($input_id = '') {
-
+