X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/42aebe6945a3a60c8f73853bea2c8b202d64a20b..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-login.php diff --git a/wp-login.php b/wp-login.php index 042f29a8..4e189d86 100644 --- a/wp-login.php +++ b/wp-login.php @@ -25,19 +25,18 @@ if ( force_ssl_admin() && ! is_ssl() ) { /** * Output the login page 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 + * @param string $title Optional. WordPress login Page title to display in the `<title>` element. + * Default 'Log In'. + * @param string $message Optional. Message to display in header. Default empty. + * @param WP_Error $wp_error Optional. The error to pass. Default empty. */ -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' ); + add_action( 'login_head', 'wp_login_viewport_meta' ); if ( empty($wp_error) ) $wp_error = new WP_Error(); @@ -45,7 +44,7 @@ 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. + * Filters the error codes array for shaking the login form. * * @since 3.0.0 * @@ -56,19 +55,27 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { 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 ); + $separator = is_rtl() ? ' › ' : ' ‹ '; + ?><!DOCTYPE html> - <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> + <!--[if IE 8]> + <html xmlns="http://www.w3.org/1999/xhtml" class="ie8" <?php language_attributes(); ?>> + <![endif]--> + <!--[if !(IE 8) ]><!--> + <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> + <!--<![endif]--> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> - <title><?php bloginfo('name'); ?> › <?php echo $title; ?> + <?php echo get_bloginfo( 'name', 'display' ) . $separator . $title; ?> get_error_code() ) { ?> @@ -81,6 +88,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { * @since 3.1.0 */ do_action( 'login_enqueue_scripts' ); + /** * Fires in the login page header after scripts are enqueued. * @@ -90,22 +98,23 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { if ( is_multisite() ) { $login_header_url = network_home_url(); - $login_header_title = $current_site->site_name; + $login_header_title = get_network()->site_name; } else { - $login_header_url = __( 'http://wordpress.org/' ); + $login_header_url = __( 'https://wordpress.org/' ); $login_header_title = __( 'Powered by WordPress' ); } /** - * Filter link URL of the header logo above login form. + * Filters 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. + * Filters the title attribute of the header logo above login form. * * @since 2.1.0 * @@ -114,8 +123,6 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); $classes = array( 'login-action-' . $action, 'wp-core-ui' ); - if ( wp_is_mobile() ) - $classes[] = 'mobile'; if ( is_rtl() ) $classes[] = 'rtl'; if ( $interim_login ) { @@ -127,9 +134,10 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { if ( 'success' === $interim_login ) $classes[] = 'interim-login-success'; } + $classes[] =' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); /** - * Filter the login page body classes. + * Filters the login page body classes. * * @since 3.5.0 * @@ -141,14 +149,22 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { ?> +
-

+

get_error_codes() as $code ) { - $severity = $wp_error->get_error_data($code); - foreach ( $wp_error->get_error_messages($code) as $error ) { + $severity = $wp_error->get_error_data( $code ); + foreach ( $wp_error->get_error_messages( $code ) as $error_message ) { if ( 'message' == $severity ) - $messages .= ' ' . $error . "
\n"; + $messages .= ' ' . $error_message . "
\n"; else - $errors .= ' ' . $error . "
\n"; + $errors .= ' ' . $error_message . "
\n"; } } if ( ! empty( $errors ) ) { /** - * Filter the error messages displayed above the login form. + * Filters the error messages displayed above the login form. * * @since 2.1.0 * @@ -188,7 +204,7 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') { } if ( ! empty( $messages ) ) { /** - * Filter instructional messages displayed above the login form. + * Filters instructional messages displayed above the login form. * * @since 2.5.0 * @@ -209,7 +225,10 @@ function login_footer($input_id = '') { // Don't allow interim logins to navigate away from the page. if ( ! $interim_login ): ?> -

+

@@ -234,9 +253,10 @@ function login_footer($input_id = '') {