how to change some comment form fields in wordpress?

Change some comment form fields in wordpress post.

Team Leader Asked on March 4, 2017 in WORDPRESS.
Add Comment
1 Answer(s)

Update “comment_array” as per your need and pass it to comment_form()

<?php $comment_array = array( 'title_reply'=>'Leave your message:',
'fields' => apply_filters( 'comment_form_default_fields', array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Your Full Name' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="20"' . $aria_req . ' /></p>',
'email' => '<p class="comment-form-email">' .
'<label for="email">' . __( 'Your Email ID' ) . '</label> ' .
( $req ? '<span>*</span>' : '' ) .
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="20"' . $aria_req . ' />'.'</p>',
'url' => '' ) ),
'comment_field' => '<p>' .
'<label for="comment">' . __( 'Your message:' ) . '</label>' .
'<textarea id="comment" name="comment" cols="40" rows="8" aria-required="true"></textarea>' .
'</p>',
'comment_notes_after' => '',
);
comment_form($comment_array); ?>
Team Leader Answered on June 29, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.