WordPress.org

Ready to get started?Download WordPress

Forums

Comment form hook question (2 posts)

  1. nicosFR
    Member
    Posted 6 years ago #

    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 ?

  2. Kafkaesqui

    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic