WordPress at a glance
filter is not described

wp_get_attachment_link filter-hook . WP 2.7.0

Filters a retrieved attachment page link.


add_filter( 'wp_get_attachment_link', 'filter_function_name_3660', 10, 7 );
function filter_function_name_3660( $link_html, $id, $size, $permalink, $icon, $text, $attr ){
	// filter...

	return $link_html;
The page link HTML output.
Post ID.
Size of the image. Image size or array of width and height values (in that order).
Default: 'thumbnail'
Whether to add permalink to image.
Default: false
Whether to include an icon.
Default: false
If string, will be link text.
Default: false
Array or string of attributes.
Default: ''


Since 2.7.0 Introduced.
Since 5.1.0 Added the $attr parameter.

Where the hook is called

wp-includes/post-template.php 1643
return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text, $attr );

Where in WP core the hook is used

Usage not found!