the_attachment_link

The timeline below displays how wordpress function the_attachment_link has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

//
// Attachments.
//
/**
 * Displays an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $post       Optional. Post ID or post object.
 * @param bool        $fullsize   Optional. Whether to use full size. Default false.
 * @param bool        $deprecated Deprecated. Not used.
 * @param bool        $permalink Optional. Whether to include permalink. Default false.
 */
function the_attachment_link($post = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5.0');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($post, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($post, 'thumbnail', $permalink);
    }
}

WordPress Version: 5.5

//
// Attachments.
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @param bool        $fullsize     Optional. Whether to use full size. Default false.
 * @param bool        $deprecated   Deprecated. Not used.
 * @param bool        $permalink    Optional. Whether to include permalink. Default false.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5.0');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}

WordPress Version: 5.4

//
// Attachments.
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @param bool        $fullsize     Optional, default is false. Whether to use full size.
 * @param bool        $deprecated   Deprecated. Not used.
 * @param bool        $permalink    Optional, default is false. Whether to include permalink.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5.0');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}

WordPress Version: 4.6

//
// Attachments
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @param bool        $fullsize     Optional, default is false. Whether to use full size.
 * @param bool        $deprecated   Deprecated. Not used.
 * @param bool        $permalink    Optional, default is false. Whether to include permalink.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5.0');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}

WordPress Version: 4.1

//
// Attachments
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @param bool        $fullsize     Optional, default is false. Whether to use full size.
 * @param bool        $deprecated   Deprecated. Not used.
 * @param bool        $permalink    Optional, default is false. Whether to include permalink.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}

WordPress Version: 3.9

//
// Attachments
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int|WP_Post $id Optional. Post ID or post object.
 * @param bool $fullsize Optional, default is false. Whether to use full size.
 * @param bool $deprecated Deprecated. Not used.
 * @param bool $permalink Optional, default is false. Whether to include permalink.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}

WordPress Version: 3.7

//
// Attachments
//
/**
 * Display an attachment page link using an image or icon.
 *
 * @since 2.0.0
 *
 * @param int $id Optional. Post ID.
 * @param bool $fullsize Optional, default is false. Whether to use full size.
 * @param bool $deprecated Deprecated. Not used.
 * @param bool $permalink Optional, default is false. Whether to include permalink.
 */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false)
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.5');
    }
    if ($fullsize) {
        echo wp_get_attachment_link($id, 'full', $permalink);
    } else {
        echo wp_get_attachment_link($id, 'thumbnail', $permalink);
    }
}