Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#35141 closed defect (bug) (fixed)

Remove title attributes: the Star Rating

Reported by: afercia's profile afercia Owned by: afercia's profile afercia
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.4
Component: Administration Keywords: has-screenshots, has-patch, title-attribute
Focuses: ui, accessibility Cc:


See related #24766 and all the following tickets about title attributes.

The Star Rating (wp_star_rating()) outputs a rating visually rendered with "stars" and optionally the number of ratings.

Hovering the stars, a title attribute appears that repeats the same information already conveyed by text hidden with screen-reaer-text. See screenshot:

I'd propose to simply remove the title attribute:

  • sighted users can actually see the stars, no need for a title attribute
  • the hidden text is already available for assistive tech users

A proper fix should also hide to assistive technologies the visible number of ratings (already included in the hidden text) using aria-hidden.

Attachments (1)

35141.patch (3.4 KB) - added by afercia 8 years ago.

Download all attachments as: .zip

Change History (4)

8 years ago

#1 @afercia
8 years ago

  • Keywords has-patch added
  • Owner set to afercia
  • Status changed from new to assigned

Please notice the proposed patch also removes two trailing spaces in /wp-admin/includes/template.php (my editor does that automatically on saving).

#2 @SergeyBiryukov
8 years ago

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

In 36092:

Remove redundant title attribute from wp_star_rating(). Hide the visible number of ratings from assistive technologies.

This data is redundant, as the same information is already conveyed by the text hidden with .screen-reader-text class.

Props afercia.
Fixes #35141.

#3 @afercia
7 years ago

  • Keywords title-attribute added
Note: See TracTickets for help on using tickets.