Filter hook 'wp_get_attachment_link'

in WP Core File wp-includes/post-template.php at line 1705

Description

Filters a retrieved attachment page link.

Occurrences

Filename Line Number
wp-includes/post-template.php 1705

Parameters

Type Name Description
string $link_html The page link HTML output.
int|WP_Post $post Post ID or object. Can be 0 for the current global post.
string|int[] $size Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
bool $permalink Whether to add permalink to image. Default false.
bool $icon Whether to include an icon.
string|false $text If string, will be link text.
array|string $attr Array or string of attributes.

PHP Doc

/**
	 * Filters a retrieved attachment page link.
	 *
	 * @since 2.7.0
	 * @since 5.1.0 Added the `$attr` parameter.
	 *
	 * @param string       $link_html The page link HTML output.
	 * @param int|WP_Post  $post      Post ID or object. Can be 0 for the current global post.
	 * @param string|int[] $size      Requested image size. Can be any registered image size name, or
	 *                                an array of width and height values in pixels (in that order).
	 * @param bool         $permalink Whether to add permalink to image. Default false.
	 * @param bool         $icon      Whether to include an icon.
	 * @param string|false $text      If string, will be link text.
	 * @param array|string $attr      Array or string of attributes.
	 */