apply_filters( 'wp_get_attachment_link', string $link_html, int|WP_Post $id, string|int[] $size, bool $permalink, bool $icon, string|false $text, array|string $attr )

Filters a retrieved attachment page link.



(string) The page link HTML output.


(int|WP_Post) Post ID or object. Can be 0 for the current global post.


(string|int[]) Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).


(bool) Whether to add permalink to image. Default false.


(bool) Whether to include an icon.


(string|false) If string, will be link text.


(array|string) Array or string of attributes.

Top ↑


File: wp-includes/post-template.php

View on Trac

Top ↑


Version Description
5.1.0 Added the $attr parameter.
2.7.0 Introduced.

Top ↑

User Contributed Notes

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