wp_embed_excerpt_attachment

函式
wp_embed_excerpt_attachment ( $content )
引數
  • (string) $content The current post excerpt.
    Required:
返回值
  • (string) The modified post excerpt.
定義位置
相關方法
wp_embed_excerpt_morewp_delete_attachmentwp_insert_attachmentwp_maybe_generate_attachment_metadatawp_ajax_get_attachment
引入
4.4.0
棄用
-

wp_embed_extract_attachment:當附件嵌入到文章或頁面中時,此函式會為附件生成摘錄。它將附件ID作為引數,並返回附件的HTML摘錄。

過濾嵌入模板的文章摘錄。

顯示視訊和音訊附件的播放器。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_embed_excerpt_attachment( $content ) {
if ( is_attachment() ) {
return prepend_attachment( '' );
}
return $content;
}
function wp_embed_excerpt_attachment( $content ) { if ( is_attachment() ) { return prepend_attachment( '' ); } return $content; }
function wp_embed_excerpt_attachment( $content ) {
	if ( is_attachment() ) {
		return prepend_attachment( '' );
	}

	return $content;
}

常見問題

FAQs
檢視更多 >