commentrss2_item
云策文档标注
概述
commentrss2_item 是一个 WordPress 动作钩子,在 RSS2 评论源的每个项目末尾触发,用于在评论显示时执行自定义操作。
关键要点
- 触发时机:在每个 RSS2 评论源项目的末尾
- 参数:$comment_id(评论 ID,整数类型)和 $comment_post_id(关联文章 ID,整数类型)
- 用途:允许开发者通过 add_action 钩入此动作,以自定义评论在 RSS 源中的输出或处理
- 版本历史:自 WordPress 2.1.0 版本引入
代码示例
do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
原文内容
Fires at the end of each RSS2 comment feed item.
Parameters
$comment_idint-
The ID of the comment being displayed.
$comment_post_idint-
The ID of the post the comment is connected to.
Source
do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |