From 904365731af9d191318573615b8fafec5a55f99d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 14 Mar 2019 21:10:50 +0000 Subject: [PATCH] Acessibility: Remove `title` attribute in `login_header()`. * Deprecate `login_headertitle` filter, introduce `login_headertext` as a replacement. * For backwards compatibility, if a `login_headertitle` is set, it will be used as link text. * Make the login header logo URL and text consistent between single site and Multisite. * Avoid ambiguity of where the WordPress logo points to; link to WordPress.org by default. * `login_headerurl` filter is still available to change the URL of the header logo. Props afercia, pratikkry, chetan200891. Fixes #42537. Built from https://develop.svn.wordpress.org/trunk@44899 git-svn-id: http://core.svn.wordpress.org/trunk@44730 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 41 +++++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 9837f02282..4229e59c7c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44898'; +$wp_version = '5.2-alpha-44899'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 07cf87fcff..72fcae266d 100644 --- a/wp-login.php +++ b/wp-login.php @@ -113,13 +113,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { */ do_action( 'login_head' ); - if ( is_multisite() ) { - $login_header_url = network_home_url(); - $login_header_title = get_network()->site_name; - } else { - $login_header_url = __( 'https://wordpress.org/' ); - $login_header_title = __( 'Powered by WordPress' ); - } + $login_header_url = __( 'https://wordpress.org/' ); /** * Filters link URL of the header logo above login form. @@ -130,24 +124,34 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { */ $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); + $login_header_title = ''; + /** * Filters the title attribute of the header logo above login form. * * @since 2.1.0 + * @deprecated 5.2.0 Use login_headertext * * @param string $login_header_title Login header logo title attribute. */ - $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); + $login_header_title = apply_filters_deprecated( + 'login_headertitle', + array( $login_header_title ), + '5.2.0', + 'login_headertext', + __( 'Usage of the title attribute on the login logo is not recommended for accessibility reasons. Use the link text instead.' ) + ); - /* - * To match the URL/title set above, Multisite sites have the blog name, - * while single sites get the header title. + $login_header_text = empty( $login_header_title ) ? __( 'Powered by WordPress' ) : $login_header_title; + + /** + * Filters the link text of the header logo above the login form. + * + * @since 5.2.0 + * + * @param string $login_header_text The login header logo link text. */ - if ( is_multisite() ) { - $login_header_text = get_bloginfo( 'name', 'display' ); - } else { - $login_header_text = $login_header_title; - } + $login_header_text = apply_filters( 'login_headertext', $login_header_text ); $classes = array( 'login-action-' . $action, 'wp-core-ui' ); if ( is_rtl() ) { @@ -187,11 +191,8 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { do_action( 'login_header' ); ?>
-

+