wp_insert_comment

动作钩子
do_action( 'wp_insert_comment', $id, $comment )
参数
  • (int) $id The comment ID.
    Required:
  • (WP_Comment) $comment Comment object.
    Required:
定义位置
相关勾子
rest_insert_commentrest_pre_insert_commentwp_count_commentswp_set_comment_statuswp_list_comments_args
相关方法
wp_insert_commentwp_list_commentswp_new_commentwp_filter_commentwp_insert_attachmentwp_insert_post
引入
2.8.0
弃用
-

wp_insert_comment: 这个函数在数据库中插入一个新的评论。该评论被添加到评论表中,并与一个文章或一个页面相关联。

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

do_action( 'wp_insert_comment', $id, $comment );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 19:32:59

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: