WordPress.org

Make WordPress Core

Opened 7 days ago

#54824 new defect (bug)

Hide "view" link from Media Library List Mode if empty string passed to attachment_link

Reported by: oh_hello Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: 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 (1)

view-link-media-library.png (107.1 KB) - added by oh_hello 7 days ago.
Screenshot of the "view" link being referenced.

Download all attachments as: .zip

Change History (1)

@oh_hello
7 days ago

Screenshot of the "view" link being referenced.

Note: See TracTickets for help on using tickets.