I am trying to validate a comment before adding it into the database. Basically, I want to limit one comment per user per post. I thought I could write a function to check this, but it looks like there isn’t a hook to do a check BEFORE posting a comment. The closest I found was “comment_post” but that runs just AFTER a comment is saved in the database.
Anyone know if there is an action hook that check before you post a comment or if there is a plugin out there that lets you limit one comment per user per post?
It’s been a month but for future Googler’s (like myself):
If that’s the only problem then why not have the comment save itself, then hook to comment_post to check and then update the status or delete the comment if one already exists by that author/email or whatever you are validating against.
Viewing 1 replies (of 1 total)
The topic ‘Checking comments before posting’ is closed to new replies.
(@daxdiri)
16 years ago
I am trying to validate a comment before adding it into the database. Basically, I want to limit one comment per user per post. I thought I could write a function to check this, but it looks like there isn’t a hook to do a check BEFORE posting a comment. The closest I found was “comment_post” but that runs just AFTER a comment is saved in the database.
Anyone know if there is an action hook that check before you post a comment or if there is a plugin out there that lets you limit one comment per user per post?