wpseek.com
WordPress开发者和主题制作者的搜索引擎



the_attachment_link › WordPress Function

Since2.0.0
已弃用n/a
the_attachment_link ( $post = 0, $fullsize = false, $deprecated = false, $permalink = false )
参数: (4)
  • (int|WP_Post) $post Optional. Post ID or post object.
    Required: No
    默认:
  • (bool) $fullsize Optional. Whether to use full size. Default false.
    Required: No
    默认: false
  • (bool) $deprecated Deprecated. Not used.
    Required: No
    默认: false
  • (bool) $permalink Optional. Whether to include permalink. Default false.
    Required: No
    默认: false
定义在:
文档:

Displays an attachment page link using an image or icon.



源码

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