wp_trim_excerpt
Filters the trimmed excerpt string.
Usage
add_filter( 'wp_trim_excerpt', 'wp_kama_trim_excerpt_filter', 10, 2 ); /** * Function for `wp_trim_excerpt` filter-hook. * * @param string $text The trimmed text. * @param string $raw_excerpt The text prior to trimming. * * @return string */ function wp_kama_trim_excerpt_filter( $text, $raw_excerpt ){ // filter... return $text; }
- $text(string)
- The trimmed text.
- $raw_excerpt(string)
- The text prior to trimming.
Changelog
Since 2.8.0 | Introduced. |
Where the hook is called
wp-includes/formatting.php 4029
return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );