the_excerpt_embed() WordPress Function

The the_excerpt_embed() function allows you to embed an excerpt of a post or page in another post or page. This is useful if you want to include a summary of another post on your website. To use this function, simply add the following code to the post or page where you want the excerpt to appear: [the_excerpt_embed] You can also specify the post or page ID of the post or page you want to embed the excerpt from. For example, if the ID of the post you want to embed the excerpt from is 123, you would use the following code: [the_excerpt_embed id="123"] The the_excerpt_embed() function can be used in conjunction with the_excerpt() function to display the excerpt on its own. Simply use the following code: [the_excerpt_embed] [the_excerpt]

the_excerpt_embed() #

Displays the post excerpt for the embed template.


Description

Intended to be used in ‘The Loop’.


Top ↑

Source

File: wp-includes/embed.php

function the_excerpt_embed() {
	$output = get_the_excerpt();

	/**
	 * Filters the post excerpt for the embed template.
	 *
	 * @since 4.4.0
	 *
	 * @param string $output The current post excerpt.
	 */
	echo apply_filters( 'the_excerpt_embed', $output );
}


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.