Opened 3 years ago
Closed 20 months ago
#54824 closed defect (bug) (fixed)
Hide "view" link from Media Library List Mode if empty string passed to attachment_link
Reported by: | oh_hello | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | 5.6 |
Component: | Media | Keywords: | has-patch commit |
Focuses: | accessibility | Cc: |
Description
As of WP 5.6.0, an empty string can be passed to attachment_link
which will disable the view attachment page link on the media modal. That's great. Ref: https://developer.wordpress.org/reference/hooks/attachment_link/.
However, there's another link that should also be disabled in this scenario.
That's the "View" link that appears when hovering over a media item when browsing the Media Library in "List Mode" instead of "Grid Mode".
Currently, that "View" link is just empty. The code generated is:
<a href="" aria-label="View “title of media item”" rel="bookmark">View</a>
Ideally that "View" link would be removed entirely.
Attachments (5)
Change History (16)
#1
@
22 months ago
- Focuses accessibility added
- Milestone changed from Awaiting Review to 6.2
- Owner set to joedolson
- Status changed from new to accepted
- Version set to 5.6
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
20 months ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
20 months ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
20 months ago
#6
@
20 months ago
- Keywords needs-testing removed
Tested by adding filter
add_filter( 'attachment_link', function() use ($link) { return ''; });
Before patch: view link present, empty URL.
After patch: no view link.
Screenshots coming.
This ticket was mentioned in PR #3986 on WordPress/wordpress-develop by @joedolson.
20 months ago
#8
Test changes to remove list table link when attachment link is filter to empty value.
Trac ticket: https://core.trac.wordpress.org/ticket/54824
@joedolson commented on PR #3986:
20 months ago
#9
@joedolson commented on PR #3986:
20 months ago
#10
#11
@
20 months ago
- Resolution set to fixed
- Status changed from accepted to closed
This was closed in r55218, but didn't get auto-closed.
Media: Hide 'view' link if empty string passed to attachment_link. Fix empty href attribute on 'View' link when the attachment_link filter is used to hide attachment pages. Props oh_hello, iqbalrony. Fixes #54824.
Screenshot of the "view" link being referenced.