Opened 15 years ago
Closed 9 years ago
#12431 closed enhancement (fixed)
Record comment meta in wp_new_comment
Reported by: | tellyworth | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
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 (2)
Change History (7)
#4
@
9 years ago
- Keywords dev-feedback removed
- Milestone changed from Future Release to 4.4
- Owner set to boonebgorges
- Status changed from new to assigned
12431.diff works, does it in wp_insert_post()
Note: See
TracTickets for help on using
tickets.
Needs to be re-reviewed for inclusion.