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

Filters a retrieved attachment page link.

Description Description

Parameters Parameters


(string) The page link HTML output.


(int) Post ID.


(string|array) Size of the image. Image size or array of width and height values (in that order). Default 'thumbnail'.


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


(bool) Whether to include an icon. Default false.


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


(array|string) Array or string of attributes. Default empty.

Top ↑

Source Source

File: wp-includes/post-template.php

View on Trac

Top ↑

Changelog Changelog

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

Top ↑

User Contributed Notes User Contributed Notes

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