wp_handle_comment_submission
wp_handle_comment_submission ( $comment_data )
Parameters:- (array) comment_data { Comment data. @type string|int $comment_post_ID The ID of the post that relates to the comment. @type string $author The name of the comment author. @type string $email The comment author email address. @type string $url The comment author URL. @type string $comment The content of the comment. @type string|int $comment_parent The ID of this comment's parent, if any. Default 0. @type string $_wp_unfiltered_html_comment The nonce value for allowing unfiltered HTML. }
Returns:- (WP_Comment|WP_Error) A WP_Comment object on success, a WP_Error object on failure.
Defined at: - Introduced in WordPress: 4.4.0
- Deprecated in WordPress: —
Description
Handles the submission of a comment, usually posted to wp-comments-post.php via a comment form.This function expects unslashed data, as opposed to functions such as `wp_new_comment()` which
expect slashed data.