comment_form ( $args = array(), $post_id = null )

  • (array) $args { Optional. Default arguments and form fields to override.
  • (int|WP_Post) $post_id Post ID or WP_Post object to generate the form for. Default current post.
Defined at:
Change Log:
  • 4: .
  • 4: .
  • 4: .
  • 4: .
  • 4: .
  • 4: .


Outputs a complete commenting form for use within a template.

Most strings and form fields may be controlled through the $args array passed into the function, while you may also choose to use the {@see 'comment_form_default_fields'} filter to modify the array of default fields if you'd just like to add a new one or remove a single field. All fields are also individually passed through a filter of the {@see 'comment_form_field_$name'} where $name is the key used in the array of fields.

Related Functions

comment_form_title, comment_author, meta_form, comments_rss, comment_time

Top Google Results

User discussions

wpseek mobile