Opened 3 years ago
Last modified 3 years ago
#12431 new enhancement
Record comment meta in wp_new_comment
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Comments | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | has-patch |
Description
Spam filter plugins usually trigger on the preprocess_comment filter, which obviously happens prior to storing the comment (and thus prior to knowing comment_ID).
Comment meta would be ideal for storing spam status information, but since the comment_ID isn't known at that point, doing so involves jumping through some hoops.
This patch provides a simple way for spam filters to include comment metadata from preprocess_comment. They simply include values in a 'comment_meta' array like this:
add_action('preprocess_comment', 'my_spam_handler');
function my_spam_handler($comment) {
$comment['comment_meta']['my_spam_status'] = 'not-spam';
return $comment;
}
Each key/value pair in the comment_meta array is stored as comment metadata.
Attachments (1)
Change History (3)
tellyworth
— 3 years ago
comment:1
Denis-de-Bernardy
— 3 years ago
- Milestone changed from Unassigned to 3.1