wp_trim_excerpt


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

Parameters:
  • (string) $text 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 is null.
Returns:
  • (string) The excerpt.
Defined at:
Change Log:
  • 5: .

Description

Generates an excerpt from the content, if needed.

The excerpt word amount will be 55 words and if the amount is greater than that, then the string ' […]' will be appended to the excerpt. If the string is less than 55 words, then the content will be returned as is.

The 55 word limit can be modified by plugins/themes using the {@see 'excerpt_length'} filter The ' […]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter

Related Functions

wp_html_excerpt, the_excerpt, get_the_excerpt, wp_embed_excerpt_more, wp_print_scripts

Top Google Results

User discussions

wpseek mobile