WordPress at Your Fingertips
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_1237', 10, 7 );
function filter_function_name_1237( $link_html, $id, $size, $permalink, $icon, $text, $attr ){
	// filter...

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


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

Where the hook is called

wp-includes/post-template.php 1657
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 WordPress

Usage not found.