apply_filters( ‘wp_trim_words’, string $text, int $num_words, string $more, string $original_text )

In this article

Filters the text content after words have been trimmed.

Parameters

$textstring
The trimmed text.
$num_wordsint
The number of words to trim the text to. Default 55.
$morestring
An optional string to append to the end of the trimmed text, e.g. ….
$original_textstring
The text before it was trimmed.

Source

return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );

Changelog

VersionDescription
3.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.