WPDev.one
Core Function
View Source on Trac ↗

wp_trim_excerpt()

wp_trim_excerpt( mixed $text = '', mixed $post = null )

Generates an excerpt from the content, if needed.

Parameters 1 required

Name / Type Description
$text
string

Optional. The excerpt. If set to empty, an excerpt is generated.

(WP_Post

| object | int) $post Optional. WP_Post instance or Post ID/object. Default null.

Required

Return Value

(string)
The excerpt.

Function Information

Since Version
1.5.0
Source File
wp-includes/formatting.php
Advertisement