This documentation describes unreleased changes on the main branch.

wp_post_excerpt()

Twig function of the framework; its result is escaped like any value.

{{ wp_post_excerpt(id) }}

The excerpt of a post as plain text, from get_the_excerpt(): a manual excerpt or one generated from the content, with HTML tags removed and entities decoded. Returns '' if the ID is null, the post does not exist or is not publicly viewable (except when the block editor renders the block).

<p>{{ wp_post_excerpt(attrs.target) }}</p>
ParameterTypeDefaultDescription
idint|nullrequiredID of the post, e.g. from a reference attribute.

Returns string