Make WordPress Core

Opened 5 months ago

Last modified 11 days ago

#62835 accepted defect (bug)

Remove title attributes from author link functions

Reported by: sabernhardt's profile sabernhardt Owned by: joedolson's profile joedolson
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: Users Keywords: title-attribute has-patch has-unit-tests needs-dev-note
Focuses: accessibility Cc:

Description

Related: #24766 and #26559

#26559 retained some title attributes because the "Posts by author" and "Visit author's website" tooltips still had a small additional value for anyone who could access them. (The important information was already in the visible link text.)

Discussion on #24766 started to reconsider either removing the title attributes or changing them.

@audrasjb:

Shouldn't we just replace the title attribute with aria-label?

@joedolson:

This should also consider a text order change. For screen reader users, the unique information should go first: 'website: author', 'posts: author'; but for voice command, the visible information should go first: 'author: website', 'author: posts'.

@alh0319 suggested removing the attributes in a spreadsheet, and @adnanlimdi had made a patch like that.

More than 70 themes in the directory use at least two of the three functions. The output might require some distinction between the author's website link (get_the_author_link()) and the author's post archives page (get_the_author_posts_link() and wp_list_authors()).

Alternatively, functions could add a parameter that defaults to the current title but allows removing it.

Change History (13)

This ticket was mentioned in PR #8156 on WordPress/wordpress-develop by @sabernhardt.


5 months ago
#1

  • Keywords has-patch has-unit-tests added

Option 1: Remove title attributes, and update unit tests.

Props adnanlimdi

Trac 62835

#2 @joedolson
5 months ago

I still think that we need to be able to differentiate between the two different links; otherwise we're making an existing accessibility issue worse, by having links to two different resources with the same text.

This ticket was mentioned in PR #8182 on WordPress/wordpress-develop by @sabernhardt.


5 months ago
#3

Option 2:

  • Removes 'Posts by %s' title attributes from get_the_author_posts_link(), the_author_posts_link() and wp_list_authors().
  • Creates a new $use_title_attr parameter for website links in get_the_author_link() and the_author_link().

By default, this would keep a distinction between links from get_the_author_link() functions and the post archive links, if they are on the same page.

Like option 1, it would also remove Core's 'Posts by %s' string, which at least 18 plugins and one recently unlisted theme have used.

Trac 62835

This ticket was mentioned in PR #8183 on WordPress/wordpress-develop by @sabernhardt.


5 months ago
#4

Option 3:
Creates a new $use_title_attr argument for each of the author link functions.

By default, this should not change the output of these functions.

Trac 62835

@sabernhardt commented on PR #8183:


5 months ago
#5

The function the_author_posts_link() deprecated an `$idmode` parameter. If that parameter needs to remain deprecated and unused, I could undo the changes to that function in this PR. Then anyone who wants to remove the title attribute would use
echo get_the_author_posts_link( false );

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


4 months ago

#7 @joedolson
4 months ago

  • Milestone changed from Awaiting Review to 6.8
  • Owner set to joedolson
  • Status changed from new to accepted

#8 @audrasjb
4 months ago

Personally, I'd go with Option 2 (PR 8182). Option 3 (PR 8183) looks way overkill to me :)

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


3 months ago

@sabernhardt commented on PR #8156:


3 months ago
#10

Option 1 would not distinguish between similar links, so I'm closing the first PR.

#11 follow-up: @joedolson
3 months ago

I think option 2 makes the most sense, as well. I'm not thrilled about still using the title attribute to differentiate between these, since it's such a low priority marker. While it *technically* provides a difference between the links, it'll only be perceivable to a small percentage of users.

But adding an aria-label would mean that the difference is perceivable to all screen reader users, but to no one else, and would cause some problems for voice command.

Given that the best option right now is for authors to not use the_author_link(), so that they can customize the link text, I feel like allowing authors to set the existing title attribute as the link text would be a good fallback.

#12 in reply to: ↑ 11 @sabernhardt
3 months ago

  • Keywords needs-dev-note added
  • Milestone changed from 6.8 to 6.9

I feel like allowing authors to set the existing title attribute as the link text would be a good fallback.

I have not yet checked whether this is already possible with PR 8182 (likely using a filter). However, I do not recommend committing these changes late in the beta stage.

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


11 days ago

Note: See TracTickets for help on using tickets.