W3cubDocs

/WordPress

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.

Parameters

$link_html

(string) The page link HTML output.

$id

(int) Post ID.

$size

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

$permalink

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

$icon

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

$text

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

$attr

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

Source

File: wp-includes/post-template.php

View on Trac

Changelog

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

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_get_attachment_link