how to change some comment form fields in wordpress?
Change some comment form fields in wordpress post.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
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); ?>