Forums

Checking comments before posting (2 posts)

  1. daxdiri
    Member
    Posted 2 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?

  2. terriann
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic