0

I'm trying to integrate a new security checker service into WordPress comments. My goal is to tell the service's api to scan all links in a comment.

My question is: what is the earliest (or most proper) hook to use to add comment meta keeping in mind that the goal is to automatically mark comments as spam?

1

If you look at the source for wp_new_comment() there is comment_post action hook, which fires immediately after comment is inserted into database and so is probably what fits your needs.

However logically it's after decision if comment is spam or not, I am not sure how meta is involved in your case since approval status is not natively meta field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.