Title: Comment form hook question
Last modified: August 19, 2016

---

# Comment form hook question

 *  [nicosFR](https://wordpress.org/support/users/nicosfr/)
 * (@nicosfr)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/comment-form-hook-question/)
 * Hi,
 * I’m writing a simple plugin to add various actions when a user posts a comment.
   
   I have added custom fields below the comment form using the comment_form hook.
 * What I would like to do is to have those fields output before the comment submit
   button. Is it or do I have to hardcode my fields in the comment template ?

Viewing 1 replies (of 1 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/comment-form-hook-question/#post-697718)
 * The only template hook I’m aware of meant specifically for comments is ‘comment_form’.
   And of course that will only work when a theme has the hook (not all do).
 * I can imagine doing this programmatically by having your plugin conditionally
   test for single post or Page queries, then using output buffering to parse the
   page’s content, etc. Not a very workable solution in the best of conditions. 
   So yeah, explaining how to add these fields to ones template is your option here.

Viewing 1 replies (of 1 total)

The topic ‘Comment form hook question’ is closed to new replies.

## Tags

 * [comment_form](https://wordpress.org/support/topic-tag/comment_form/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 3 months ago](https://wordpress.org/support/topic/comment-form-hook-question/#post-697718)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
