New Comment Functions

Courtesy of Andy we have some new comment creation functions.

  • wp_insert_comment() – Add a new comment to the DB
  • wp_update_comment() – Update an existing comment in the DB
  • wp_filter_comment() – Filter comment data
  • wp_allow_comment() – Perform various spam checks on a comment

This is in addition to the already existing wp_new_comment(). The extra functions allow importers to skip spam checks and comment notifications when importing comments. The new functions are already being put to use in the Blogger importer.

5 comments to New Comment Functions

  1. Crow says:

    Do any of these new comment functions allow for nested comments in the new and improved WP?

  2. ryan says:

    No. None of these functions are used in templates. These are backend functions useful to plugin and importer developers.

  3. Andy says:

    Ryan, I did make sure wp_insert_comment() handles the comment_parent field. As soon as a theme or plugin supplies that data in the form post, it should work. :-)

  4. Crow says:

    I knew you guys had your thinkin’ caps on!