Editing WordPress comments : generating comment from selection

Three aspects to this:

  1. Adding the checkboxes to the comment form
  2. Adding the values from the checkboxes to the comment meta data
  3. Displaying the values of the checkboxes

    1. Assuming you want to dynamically generate these based on the headings in the article, you’ll need to parse the post content for headings and add the checkboxes to the comment form. This could be done via JS or PHP, depending on your preference. If you’re going to go with PHP you may want to make use of Transients so that you’re not parsing the content on every page load.

    2. You can use the comment_post action hook, which is fired right after the comment itself has been added to the database, to check $_POST for the checkbox fields added in 1 above and then add these as comment meta using add_comment_meta.

    3. Number of ways to do this depending on your preference. I would recommend first trying the get_comment_text filter to add the values from the meta data.