Filters the comment form fields, including the textarea.
Parameters
$comment_fields
array- The comment fields.
Source
$comment_fields = apply_filters( 'comment_form_fields', $comment_fields );
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
Filters the comment form fields, including the textarea.
$comment_fields
array$comment_fields = apply_filters( 'comment_form_fields', $comment_fields );
Version | Description |
---|---|
4.4.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
These are the default comment form fields, as seen here https://developer.wordpress.org/reference/functions/comment_form/
Move the comment text field to the bottom.
To override the comment form fields to supply your own with modifications, without a plugin, here is an example that would go in your
functions.php
file:This will render the complete form for users not logged in, and render only the comment field for those logged in. For the form to function properly, default IDs, Classes, For, and Names should be included. You may add additional classes, replace the
p
element with adiv
, and/or move thelabel
to be after theinput
ortextarea
for CSS reasons (e.g. Material design).