Opened 4 years ago
Closed 4 years ago
#52387 closed defect (bug) (fixed)
adjacent_image_link returns a link with no accessible text
Reported by: | joedolson | Owned by: | antpb |
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Media | Keywords: | has-patch needs-testing |
Focuses: | accessibility | Cc: |
Description
The function adjacent_image_link()
, used by previous_image_link()
and next_image_link()
, either returns a text link (if the $text
parameter has a value) or a linked image. If the value returned is a linked image, the image is returned with no alt attribute, resulting in an empty link.
Attachments (1)
Change History (12)
#1
@
4 years ago
Patch uses the image title, on two grounds:
1) The image title will always be present, where the alt attribute is not.
2) The image title represents the target of the link, where the alt attribute represents the image itself.
This ticket was mentioned in Slack in #themereview by joedolson. View the logs.
4 years ago
This ticket was mentioned in Slack in #core-media by joedolson. View the logs.
4 years ago
#6
@
4 years ago
Code looks good, it seems there is no unit test related to that function, so I guess it's ok.
It would be nice to provide steps to test the current patch.
#7
@
4 years ago
1) Upload a minimum of three images in your test environment.
2) In one of the core themes that uses the functions previous_image_link
and next_image_link
(I used Twenty Twelve), edit image.php
so that the function is called using an image, rather than text: previous_image_link( 'thumbnail', false )
3) View an image attachment page.
Before patch: Image thumbnails are shown representing the previous and next images; these images have no alt attribute.
After patch: Image thumbnails are shown with an alt attribute containing the title field for the image.
(There are no core theme uses of the function that call it in the thumbnail mode as far as I can find.)
#8
@
4 years ago
- Milestone changed from Awaiting Review to 5.7
I tested with the Responsive theme, which has thumbnail navigation. Each of the linked previous and next images has alt text that matches the heading shown on the target image's attachment page.
Pass alt attribute with img title.