comment_excerpt_length
云策文档标注
概述
comment_excerpt_length 是一个 WordPress 过滤器,用于控制评论摘要中显示的最大单词数。开发者可以通过此过滤器自定义评论摘要的长度,以适应不同主题或插件的需求。
关键要点
- comment_excerpt_length 过滤器允许修改评论摘要的单词数量限制。
- 参数 $comment_excerpt_length 是一个整数,指定评论摘要中要显示的单词数。
- 该过滤器在 WordPress 4.4.0 版本中引入,与 get_comment_excerpt() 函数相关。
代码示例
$comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length );
原文内容
Filters the maximum number of words used in the comment excerpt.
Parameters
$comment_excerpt_lengthint-
The amount of words you want to display in the comment excerpt.
Source
$comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length );
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |