trashed_post_comments
云策文档标注
概述
trashed_post_comments 是一个 WordPress 动作钩子,在评论被移至回收站后触发,用于执行相关操作。
关键要点
- 触发时机:评论被发送到回收站后立即执行。
- 参数:$post_id(整数,文章ID)和 $statuses(数组,评论状态数组)。
- 相关函数:与 wp_trash_post_comments() 函数关联,用于移动文章评论至回收站。
- 版本历史:自 WordPress 2.9.0 版本引入。
原文内容
Fires after comments are sent to the Trash.
Parameters
$post_idint-
Post ID.
$statusesarray-
Array of comment statuses.
Source
do_action( 'trashed_post_comments', $post_id, $statuses );
Changelog
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |