Forked from danielpataki/customizing-comment-forms-fields.php
Created
April 25, 2017 11:45
-
-
Save xkungfu/9fdaf928de19f69c39e43e50c6849e71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = array( | |
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>' | |
'fields' => apply_filters( 'comment_form_default_fields', array( | |
'author' => | |
'<p class="comment-form-author">' . | |
'<label for="author">' . __( 'Name', 'domainreference' ) . '</label> ' . | |
( $req ? '<span class="required">*</span>' : '' ) . | |
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . | |
'" size="30"' . $aria_req . ' /></p>', | |
'email' => | |
'<p class="comment-form-email"><label for="email">' . __( 'Email', 'domainreference' ) . '</label> ' . | |
( $req ? '<span class="required">*</span>' : '' ) . | |
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . | |
'" size="30"' . $aria_req . ' /></p>', | |
'url' => | |
'<p class="comment-form-url"><label for="url">' . | |
__( 'Website', 'domainreference' ) . '</label>' . | |
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . | |
'" size="30" /></p>' | |
) | |
); | |
comment_form( $args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="http://danielpataki.local/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate=""> | |
<p class="comment-notes"> | |
Your email address will not be published. Required fields are marked | |
<span class="required"> | |
* | |
</span> | |
</p> | |
<p class="comment-form-author"> | |
<label for="author"> | |
Name | |
<span class="required"> | |
* | |
</span> | |
</label> | |
<input id="author" name="author" type="text" value="" size="30" aria-required="true"> | |
</p> | |
<p class="comment-form-email"> | |
<label for="email"> | |
<span class="required"> | |
* | |
</span> | |
</label> | |
<input id="email" name="email" type="email" value="" size="30" aria-required="true"> | |
</p> | |
<p class="comment-form-url"> | |
<label for="url"> | |
Website | |
</label> | |
<input id="url" name="url" type="url" value="" size="30"> | |
</p> | |
<p class="comment-form-comment"> | |
<label for="comment"> | |
Comment | |
</label> | |
<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"> | |
</textarea> | |
</p> | |
<p class="form-allowed-tags"> | |
You may use these | |
<abbr title="HyperText Markup Language"> | |
HTML | |
</abbr> | |
tags and attributes: | |
<code> | |
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> | |
</code> | |
</p> | |
<p class="form-submit"> | |
<input name="submit" type="submit" id="submit" value="Post Comment"> | |
<input type="hidden" name="comment_post_ID" value="1429" id="comment_post_ID"> | |
<input type="hidden" name="comment_parent" id="comment_parent" value="0"> | |
</p> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php comment_form( $args, $post_id ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment