wpseek.com
A WordPress-centric search engine for devs and theme authors



the_attachment_link › WordPress Function

Since2.0.0
Deprecatedn/a
the_attachment_link ( $post = 0, $fullsize = false, $deprecated = false, $permalink = false )
Parameters: (4)
  • (int|WP_Post) $post Optional. Post ID or post object.
    Required: No
    Default:
  • (bool) $fullsize Optional. Whether to use full size. Default false.
    Required: No
    Default: false
  • (bool) $deprecated Deprecated. Not used.
    Required: No
    Default: false
  • (bool) $permalink Optional. Whether to include permalink. Default false.
    Required: No
    Default: false
Defined at:
Codex:

Displays an attachment page link using an image or icon.



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 );
	}
}