Opened 5 years ago
Closed 4 years 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 |
| Component: | Media | Version: | 5.6 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: | accessibility |
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
@
4 years ago
- Focuses accessibility added
- Milestone Awaiting Review → 6.2
- Owner set to
- Status new → accepted
- Version → 5.6
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
4 years ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
4 years ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
4 years ago
#6
@
4 years 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.
4 years 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:
4 years ago
#9
@joedolson commented on PR #3986:
4 years ago
#10
#11
@
4 years ago
- Resolution → fixed
- Status accepted → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Screenshot of the "view" link being referenced.