处理提交评论,通常通过评论表发布到wp-comments-post.php。
原型
wp_handle_comment_submission( array $comment_data )
描述
此函数需要未刷新的数据,而不是像wp_new_comment()这样的函数,它们会使用斜线数据。
参数
$comment_data
(array)
(Required)
评论数据。 ‘comment_post_ID’(string | int)与评论相关的帖子的ID。 ‘author’(字符串)评论作者的姓名。 ‘email’(字符串)评论作者电子邮件地址。 ‘url’(字符串)评论作者网址。 ‘comment’(字符串)评论的内容。 ‘comment_parent’(string | int)此注释的父级的ID(如果有)。默认值为0。 ‘_wp_unfiltered_html_comment’(字符串)允许未过滤的HTML的nonce值。
源文件
路径:“
<?php
...
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_handle_comment_submission/