WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#35141 closed defect (bug) (fixed)

Remove title attributes: the Star Rating

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

Description

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:

https://cldup.com/K8b0AHPFFK.png

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 4 years ago.

Download all attachments as: .zip

Change History (4)

@afercia
4 years ago

#1 @afercia
4 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
4 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
3 years ago

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