[wp-trac] [WordPress Trac] #50561: Links Widget display: Image alt text and link name are redundant for screen readers

WordPress Trac noreply at wordpress.org
Sat Jul 4 20:32:08 UTC 2020


#50561: Links Widget display: Image alt text and link name are redundant for screen
readers
---------------------------+-----------------------------
 Reporter:  eatingrules    |      Owner:  (none)
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Widgets        |    Version:  trunk
 Severity:  minor          |   Keywords:
  Focuses:  accessibility  |
---------------------------+-----------------------------
 When using the Links Widget to display links with an Image and a Name
 ("Show Link Image" and "Show link Name" are both selected in the widget
 settings), the alt text on the image will be identical to the link name.

 For example:

 {{{
 <a href="https://eatingrules.com/how-to-make-chocolate/">
 <img src="https://eatingrules.com/wp-content/uploads/2012/10/finished-
 homemade-chocolates-128x128.jpg"  alt="How to make Chocolate"  />
  How to make Chocolate
 </a>
 }}}

 Since the image and the link name are both wrapped in the same anchor tag,
 this violates accessibility guidelines. It's redundant and would be
 annoying when using a screen reader.

 If a Link Description is added, it will use that for the alt text instead,
 which is a little bit better, since it's at least not redundant.

 However, I think a better solution would be to use an empty/null alt text
 instead, since in this case the image is decorative.
 https://www.w3.org/TR/WCAG20-TECHS/H2.html

 Another option might be to add `aria-hidden="true"` to the <img> if both
 the alt and link text are the same?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50561>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list