Forked from braddalton/Modify Comment Form Input Fields & Text Labels.php
Last active
August 29, 2015 14:18
-
-
Save khikrama/454dc5a360f3b6356954 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
function wpsites_modify_comment_form_fields($fields){ | |
$fields['author'] = '<p class="comment-form-author">' . '<label for="author">' . __( 'Author', 'wpsites.net' ) . '</label> ' . | |
( $req ? '<span class="required">*</span>' : '' ) . | |
'<input id="author" name="author" type="text" placeholder="Real name, please, no keyword spamming!" value="' . | |
esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>'; | |
$fields['email'] = '<p class="comment-form-email"><label for="email">' . __( 'Address', 'wpsites.net' ) . '</label> ' . | |
( $req ? '<span class="required">*</span>' : '' ) . | |
'<input id="email" name="email" type="text" placeholder="Preferably Linked To Your Gravatar.com Account" value="' . | |
esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>'; | |
$fields['url'] = '<p class="comment-form-url"><label for="url">' . __( 'Domain', 'wpsites.net' ) . '</label>' . | |
'<input id="url" name="url" type="text" placeholder="Please Link To Your Own Domain" value="' . | |
esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>'; | |
return $fields; | |
} | |
add_filter('comment_form_default_fields','wpsites_modify_comment_form_fields'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this code in wordpress theme functions.php