get_comment
云策文档标注
概述
get_comment 是一个 WordPress 钩子,在评论数据被检索后触发,允许开发者修改或处理评论数据。
关键要点
- 这是一个动作钩子,在 get_comment() 函数执行后触发。
- 参数 $_comment 是一个 WP_Comment 对象,包含评论数据。
- 钩子定义在 wp-includes/comment.php 文件中,自 WordPress 2.3.0 版本引入。
代码示例
$_comment = apply_filters( 'get_comment', $_comment );
原文内容
Fires after a comment is retrieved.
Parameters
$_commentWP_Comment-
Comment data.
Source
$_comment = apply_filters( 'get_comment', $_comment );
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |