the_post_thumbnail_caption

函式
the_post_thumbnail_caption ( $post = null )
引數
  • (int|WP_Post) $post Optional. Post ID or WP_Post object. Default is global `$post`.
    Required:
    Default: null
定義位置
相關方法
get_the_post_thumbnail_captionthe_post_thumbnailthe_post_thumbnail_urlget_post_thumbnail_idthe_post_navigation
引入
4.6.0
棄用
-

post_thumbnail_caption是一個WordPress函式,用於顯示當前文章或指定文章的特色影象的標題。

顯示文章縮圖的標題。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function the_post_thumbnail_caption( $post = null ) {
/**
* Filters the displayed post thumbnail caption.
*
* @since 4.6.0
*
* @param string $caption Caption for the given attachment.
*/
echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) );
}
function the_post_thumbnail_caption( $post = null ) { /** * Filters the displayed post thumbnail caption. * * @since 4.6.0 * * @param string $caption Caption for the given attachment. */ echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) ); }
function the_post_thumbnail_caption( $post = null ) {
	/**
	 * Filters the displayed post thumbnail caption.
	 *
	 * @since 4.6.0
	 *
	 * @param string $caption Caption for the given attachment.
	 */
	echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) );
}

常見問題

FAQs
檢視更多 >