WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Requesting Hook Pre-Comment Post (3 posts)

  1. null77
    Member
    Posted 7 years ago #

    Hey,

    I would like to request a hook that would allow a plugin to check some stuff and possibly prevent a comment being added.

    Why? My plugin adds age, gender and location information to comments. I want to ensure this info is entered *before* the comment is added to the DB.

    I can work around this by hooking to the form's onsubmit, or by deleting the recently entered comment after hooking to the 'comment_post' event, but these are hacks, not good solutions.

    Thank you!

  2. charle97
    Member
    Posted 7 years ago #

    preprocess_comment is the hook you're looking for.

  3. null77
    Member
    Posted 7 years ago #

    Thanks, I guess I should have thought of using the filters.

Topic Closed

This topic has been closed to new replies.

About this Topic