the_attachment_link

函数


the_attachment_link ( $post = 0, $fullsize = false, $deprecated = false, $permalink = false )
参数
  • (int|WP_Post)
    $post
    Optional. Post ID or post object.
    Required:
  • (bool)
    $fullsize
    Optional. Whether to use full size. Default false.
    Required:
    Default: false
  • (bool)
    $deprecated
    Deprecated. Not used.
    Required:
    Default: false
  • (bool)
    $permalink
    Optional. Whether to include permalink. Default false.
    Required:
    Default: false
定义位置
  • wp-includes/post-template.php
    , line 1606
引入
2.0.0
弃用

使用图像或图标显示附件页链接。

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 );
	}
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。