comment_post
do_action( ‘comment_post’, int $comment_ID, int|string …
do_action( ‘comment_post’, int $comment_ID, int|string $comment_approved, array $commentdata )
动作钩子::在将注释插入数据库后立即激发。
Action Hook: Fires immediately after a comment is inserted into the database.
动作钩子::在将注释插入数据库后立即激发。
Action Hook: Fires immediately after a comment is inserted into the database.
目录锚点:#参数#源码#笔记
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $comment_ID | (int) | 评论ID。 |
| $comment_approved | (int | string) | 如果评论被批准,则为1;如果没有,则为0;如果是垃圾邮件,则为“垃圾邮件”。 |
| $commentdata | (array) | 注释数据。 |
源码(Source)
| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 4.5.0 | wp-includes/comment.php:2165 | 1 | 0 |
笔记(Notes)
下面的示例使用comment_post挂钩在发布注释后立即运行函数。函数检查注释是否被批准,如果批准,则执行指定的代码。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!