apply_filters( ‘attachment_link’, string $link, int $post_id )

In this article

Filters the permalink for an attachment.

Parameters

$linkstring
The attachment’s permalink.
$post_idint
Attachment ID.

Source

return apply_filters( 'attachment_link', $link, $post->ID );

Changelog

VersionDescription
5.6.0Providing an empty string will now disable the view attachment page link on the media modal.
2.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.