apply_filters( 'comment_form_fields', array $comment_fields )
Filters the comment form fields, including the textarea.
Parameters
- $comment_fields
-
(array) The comment fields.
Source
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |
User Contributed Notes
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.
Expand full source codeCollapse full source code
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:Expand full source codeCollapse full source code
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).