Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#42537 closed defect (bug) (fixed)

Remove title attributes: wp-login.php

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: afercia's profile afercia
Milestone: 5.2 Priority: normal
Severity: normal Version: 4.9
Component: Login and Registration Keywords: has-patch title-attribute has-dev-note
Focuses: accessibility, multisite Cc:

Description

Background: #34625

On Multisite, the title attribute in login_header() is different from the link text and has some meaning.

<a href="http://ms.wordpress.dev/" title="Network Title" tabindex="-1">Site Title</a>

On single site, however, the title attribute just duplicates the link text and is redundant:

<a href="http://wordpress.dev/" title="Powered by WordPress" tabindex="-1">Powered by WordPress</a>

Most of the title attributes are already removed from core via #24766 and related tickets. We should consider removing this one as well, either completely or only if it duplicates the link text.

The login_headertitle filter could either be deprecated or repurposed to filter the link text instead.

Attachments (3)

42537.diff (612 bytes) - added by chetan200891 7 years ago.
Created patch to remove title attribute.
42537.2.diff (1.8 KB) - added by pratikkry 6 years ago.
deprecate login_headertitle filter and remove $login_header_title
42537.3.diff (2.5 KB) - added by afercia 6 years ago.

Download all attachments as: .zip

Change History (28)

@chetan200891
7 years ago

Created patch to remove title attribute.

#1 @chetan200891
7 years ago

  • Keywords has-patch added

I've attached the patch 42537.diff.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


7 years ago

#3 @afercia
7 years ago

  • Milestone changed from Awaiting Review to 5.0

See also #42632

#4 @afercia
6 years ago

  • Keywords title-attribute added

This ticket was mentioned in Slack in #accessibility by rianrietveld. View the logs.


6 years ago

#6 @afercia
6 years ago

  • Milestone changed from 5.0 to 4.9.9

Discussed during today's accessibility bug-scrub an agreed we'd like to propose this for 4.9.9 consideration.

#7 @pento
6 years ago

  • Milestone changed from 4.9.9 to 5.0.1

#8 @pento
6 years ago

  • Milestone changed from 5.0.1 to 5.0.2

#9 @pento
6 years ago

  • Milestone changed from 5.0.2 to 5.0.3

#10 @audrasjb
6 years ago

  • Keywords commit added

#11 @ocean90
6 years ago

  • Milestone changed from 5.0.3 to 5.1

Looks like the login_headertitle should be deprecated as well. I guess any reference to $login_header_title can be removed as well to simplify the code.

Last edited 6 years ago by ocean90 (previous) (diff)

@pratikkry
6 years ago

deprecate login_headertitle filter and remove $login_header_title

#12 @afercia
6 years ago

  • Keywords commit removed
  • Milestone changed from 5.1 to 5.2

The 5.1 release beta 1 is today, the patch probably needs a refresh and deprecation of filters needs to happen early in a release cycle. Punting to 5.2.

Last edited 6 years ago by afercia (previous) (diff)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


6 years ago

#14 @afercia
6 years ago

  • Owner set to afercia
  • Status changed from new to assigned

#15 @afercia
6 years ago

Looking a bit more into this, seems to me the current behavior on multisite is wrong.

Markup on the main network site:

<a href="http://wpmultisite.test/" title="My network title">Main site title</a>
  • the URL points to the Network home
  • the title attribute is the Network name (site_name)
  • the text is the main site name (blogname), so it can be different from the title attribute and potentially confusing

Markup on one of the network sites:

<a href="http://wpmultisite.test/" title="My network title">Site 1 title</a>
  • the URL still points to the Network home
  • the title attribute is still the Network name (site_name)
  • however, the text is the site name, which is inconsistent with the URL and title attribute

One more reason to simplify and remove the title attribute.

The link text should also match the URL and always be the name of the main site. Or, the URL should change and match the link text. This basically needs an answer to the question: where the WordPress logo should link to?

Worth also considering that, by default, the WordPress logo is displayed in all the three possible cases:

  • single site
  • network main site
  • network sites

Why the WordPress logo should be used to link to the network in the first place? I'd rather consider to drastically simplify and make it always link by default to https://wordpress.org/. Thus, there wouldn't be any ambiguity or potential confusion: it's the WordPress logo: it links to https://wordpress.org/. Simple, clear.

The filters would still allow to change everything, if desired: logo, URL, and link text.

/Cc @jeremyfelt

#16 @afercia
6 years ago

  • Focuses multisite added

This ticket was mentioned in Slack in #core-multisite by afercia. View the logs.


6 years ago

This ticket was mentioned in Slack in #core by afercia. View the logs.


6 years ago

@afercia
6 years ago

#19 @afercia
6 years ago

42537.3.diff simplifies everything as described above:

  • deprecates login_headertitle
  • introduces a new filter login_headertext
  • removes the title attribute
  • makes the URL and link text always the same on single site and multisite
  • for backwards compatibility, if a login_headertitle is set, that will be used as link text

Not sure about the unset added in [19783], I guess it can be removed?

#20 @afercia
6 years ago

  • Keywords needs-dev-note added

#21 @afercia
6 years ago

@SergeyBiryukov when you have a chance, I'd greatly appreciate your review especially on the filters part :)

This ticket was mentioned in Slack in #core by afercia. View the logs.


6 years ago

#23 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44899:

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.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


6 years ago

#25 @desrosj
5 years ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.