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
定義位置
相關方法
the_attachment_linksget_the_attachment_linkget_attachment_linkwp_get_attachment_link_fix_attachment_links
引入
2.0.0
棄用
-

the_attachment_link: 此函式顯示當前文章的附件頁面的連結。

使用影象或圖示顯示附件頁連結。

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

常見問題

FAQs
檢視更多 >