comment_post

动作钩子


do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata )
参数
  • (int)
    $comment_ID
    The comment ID.
    Required:
  • (int|string)
    $comment_approved
    1 if the comment is approved, 0 if not, ‘spam’ if spam.
    Required:
  • (array)
    $commentdata
    Comment data.
    Required:
定义位置
  • wp-includes/comment.php
    , line 2318
引入
4.5.0
弃用

在一个评论被插入数据库后立即触发。

do_action( 'comment_post', $comment_ID, $commentdata['comment_approved'], $commentdata );