wp_embed_excerpt_attachment() WordPress Function

The wp_embed_excerpt_attachment() function allows you to embed an excerpt of an attachment in a post. This is useful for when you want to display a preview of an attachment, such as an image, in a post.

wp_embed_excerpt_attachment( string $content ) #

Filters the post excerpt for the embed template.


Description

Shows players for video and audio attachments.


Top ↑

Parameters

$content

(string)(Required)The current post excerpt.


Top ↑

Return

(string) The modified post excerpt.


Top ↑

Source

File: wp-includes/embed.php

function wp_embed_excerpt_attachment( $content ) {
	if ( is_attachment() ) {
		return prepend_attachment( '' );
	}

	return $content;
}


Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.