On this page
apply_filters( 'preprocess_comment', array $commentdata )
Filters a comment’s data before it is sanitized and inserted into the database.
Parameters
$commentdataarray-
Comment data.
More Information
The $commentdata array contains the following indices:
'comment_post_ID' - The post to which the comment will apply
'comment_author' - (may be empty)
'comment_author_email' - (may be empty)
'comment_author_url' - (may be empty)
'comment_content' - The text of the proposed comment
'comment_type' - 'pingback', 'trackback', or empty for regular comments
'user_ID' - (empty if not logged in)
Source
File: wp-includes/comment.php. View all references
$commentdata = apply_filters( 'preprocess_comment', $commentdata );
Related
Used By
| Used By | Description |
|---|---|
| wp_new_comment() wp-includes/comment.php | Adds a new comment to the database. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/preprocess_comment