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



the_attachment_link ›

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

Display an attachment page link using an image or icon.



源码

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