X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/baca9ce86a38dc54c4574890ee2d352fd81f78b2..85ad385665744d9cc3bcd939906309be7268edb3:/wp-login.php?ds=sidebyside
diff --git a/wp-login.php b/wp-login.php
index 209341fa..268d2b34 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -23,39 +23,46 @@ 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 = '') {
- global $error, $interim_login, $current_site, $action;
+function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
+ global $error, $interim_login, $action;
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
+ if ( wp_is_mobile() )
+ add_action( 'login_head', 'wp_login_viewport_meta' );
+
if ( empty($wp_error) )
$wp_error = new 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 ) )
add_action( 'login_head', 'wp_shake_js', 12 );
?>
- >
+
+
+ >
+
›
@@ -63,35 +70,80 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
wp_admin_css( 'wp-admin', true );
wp_admin_css( 'colors-fresh', true );
-
- if ( wp_is_mobile() ) { ?>
- get_error_code() ) {
+ ?>
+
+ site_name;
+ $login_header_title = get_current_site()->site_name;
} else {
$login_header_url = __( 'http://wordpress.org/' );
$login_header_title = __( 'Powered by WordPress' );
}
- $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
+ /**
+ * Filter link URL of the header logo above login form.
+ *
+ * @since 2.1.0
+ *
+ * @param string $login_header_url Login header logo URL.
+ */
+ $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
+ /**
+ * Filter the title attribute of the header logo above login form.
+ *
+ * @since 2.1.0
+ *
+ * @param string $login_header_title Login header logo title attribute.
+ */
$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
- // Don't allow interim logins to navigate away from the page.
- if ( $interim_login )
- $login_header_url = '#';
-
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
if ( wp_is_mobile() )
$classes[] = 'mobile';
if ( is_rtl() )
$classes[] = 'rtl';
+ if ( $interim_login ) {
+ $classes[] = 'interim-login';
+ ?>
+
+
@@ -101,7 +153,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";
@@ -123,10 +182,26 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
$errors .= ' ' . $error . " \n";
}
}
- if ( !empty($errors) )
- echo '