wp_trim_excerpt
Filters the trimmed excerpt string.
Использование
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(строка)
- The trimmed text.
- $raw_excerpt(строка)
- The text prior to trimming.
Список изменений
| С версии 2.8.0 | Введена. |
Где вызывается хук
wp-includes/formatting.php 4041
return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );