Displays an attachment page link using an image or icon.
Parameters
$post
int|WP_Postoptional- Post ID or post object.
$fullsize
booloptional- Whether to use full size.
Default:
false
$deprecated
booloptional- Deprecated. Not used.
Default:
false
$permalink
booloptional- Whether to include permalink.
Default:
false
Source
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 );
}
}
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |
Examples