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
查看更多 >