CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Fri, 10 Oct 2025 16:08:43 GMT
content-type: text/html;charset=utf-8
vary: Accept-Encoding
etag: W/"anonymous/Wed, 10 Feb 2010 20:45:22 GMT/False"
cache-control: must-revalidate
expires: Fri, 01 Jan 1999 00:00:00 GMT
alt-svc: h3=":443"; ma=86400
strict-transport-security: max-age=31536000
x-frame-options: SAMEORIGIN
content-encoding: gzip
comment-form-different.diff on Ticket #10910 – Attachment
– WordPress Trac
Ticket #10910: comment-form-different.diff
File comment-form-different.diff, 8.6 KB (added by greenshady, 16 years ago) |
---|
Some ideas for changing the comment form. |
-
comment-template.php
1176 1176 * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. 1177 1177 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. 1178 1178 */ 1179 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {1179 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE, $echo = true ) { 1180 1180 global $comment; 1181 1181 1182 1182 if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); … … 1185 1185 $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; 1186 1186 1187 1187 if ( 0 == $replytoid ) 1188 echo$noreplytext;1188 $out = $noreplytext; 1189 1189 else { 1190 1190 $comment = get_comment($replytoid); 1191 1191 $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author(); 1192 printf( $replytext, $author );1192 $out = $replytext . $author; 1193 1193 } 1194 if ( $echo ) 1195 echo $out; 1196 else 1197 return $out; 1194 1198 } 1195 1199 1196 1200 /** … … 1465 1469 1466 1470 $req = get_option( 'require_name_email' ); 1467 1471 $aria_req = ( $req ? " aria-required='true'" : '' ); 1468 $defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array( 'author' => '<div id="form-section-author" class="form-section"> 1469 <div class="form-label"><label for="author">' . __( 'Name', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</div> 1470 <div class="form-input"><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' /></div> 1471 </div><!-- #form-section-author .form-section -->', 1472 'email' => '<div id="form-section-email" class="form-section"> 1473 <div class="form-label"><label for="email">' . __( 'Email', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . '</div> 1474 <div class="form-input"><input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' /></div> 1475 </div><!-- #form-section-email .form-section -->', 1476 'url' => '<div id="form-section-url" class="form-section"> 1477 <div class="form-label"><label for="url">' . __( 'Website', 'twentyten' ) . '</label></div> 1478 <div class="form-input"><input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" /></div> 1479 </div><!-- #form-section-url .form-section -->' ) ), 1480 'comment_field' => '<div id="form-section-comment" class="form-section"> 1481 <div class="form-label"><label for="comment">' . __( 'Comment', 'twentyten' ) . '</label></div> 1482 <div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea></div> 1483 </div><!-- #form-section-comment .form-section -->', 1484 'must_log_in' => '<p>' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 1485 'logged_in_as' => '<p>' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), 1486 'comment_notes_before' => '<p id="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 1487 'comment_notes_after' => '<div id="form-allowed-tags" class="form-section"> 1488 <p><span>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</span> <code>' . allowed_tags() . '</code></p> 1489 </div>', 1490 'id_form' => 'commentform', 1491 'id_submit' => 'submit', 1492 'title_reply' => __( 'Leave a Reply' ), 1493 'title_reply_to' => __( 'Leave a Reply to %s'), 1494 'cancel_reply_link' => __( 'Cancel reply' ), 1495 'label_submit' => __( 'Post Comment' ), 1496 ); 1472 $defaults = array( 1473 'fields' => apply_filters( 'comment_form_default_fields', array( 1474 'author' => '<p id="form-section-author" class="form-section"><label for="author">' . __( 'Name', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . ' <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" tabindex="1"' . $aria_req . ' /></p><!-- #form-section-author .form-section -->', 1475 'email' => '<p id="form-section-email" class="form-section"><label for="email">' . __( 'Email', 'twentyten' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) . ' <input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" tabindex="2"' . $aria_req . ' /></p><!-- #form-section-email .form-section -->', 1476 'url' => '<p id="form-section-url" class="form-section"><label for="url">' . __( 'Website', 'twentyten' ) . '</label> <input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" tabindex="3" /></p><!-- #form-section-url .form-section -->' ) 1477 ), 1478 'comment_field' => '<p id="form-section-comment" class="form-section"><label for="comment">' . __( 'Comment', 'twentyten' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea></p><!-- #form-section-comment .form-section -->', 1479 'must_log_in' => '<p class="log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 1480 'logged_in_as' => '<p class="logged-in">' . sprintf( __( 'Logged in as <a href="%s">%s</a>. <a href="%s" title="Log out of this account">Log out?</a></p>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), 1481 'comment_notes_before' => '<p id="comment-notes">' . __( 'Your email is <em>never</em> published nor shared.' ) . ( $req ? __( ' Required fields are marked <span class="required">*</span>' ) : '' ) . '</p>', 1482 'comment_notes_after' => '<p id="form-allowed-tags" class="form-section"><span>' . __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:' ) . '</span> <code>' . allowed_tags() . '</code></p>', 1483 'id_form' => 'commentform', 1484 'form_title' => '<h3 id="reply-title">' . comment_form_title( __( 'Leave a Reply' ), __( 'Leave a Reply to %s'), true, false ) . '</h3>', 1485 'cancel_reply' => '<p class="cancel-reply">' . get_cancel_comment_reply_link( __( 'Cancel reply' ) ) . '</p>', 1486 'submit' => '<p class="form-submit"><input name="submit" type="submit" id="submit" value="' . __( 'Post Comment' ) . '" /></p>' 1487 ); 1497 1488 $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) ); 1498 1489 1499 1490 ?> 1500 1491 <?php if ( comments_open() ) : ?> 1501 1492 <?php do_action( 'comment_form_before' ); ?> 1502 1493 <div id="respond"> 1503 <h3 id="reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3> 1494 <?php echo $args['form_title']; ?> 1495 <?php echo $args['cancel_reply']; ?> 1504 1496 <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?> 1505 1497 <?php echo $args['must_log_in']; ?> 1506 1498 <?php do_action( 'comment_form_must_log_in_after' ); ?> … … 1522 1514 <?php endif; ?> 1523 1515 <?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?> 1524 1516 <?php echo $args['comment_notes_after']; ?> 1525 < div class="form-submit">1526 <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" tabindex="<?php echo ( count( $args['fields'] ) + 2 ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />1517 <?php echo $args['submit']; ?> 1518 <div class="form-action"> 1527 1519 <?php comment_id_fields(); ?> 1520 <?php do_action( 'comment_form', $post_id ); ?> 1528 1521 </div> 1529 <?php do_action( 'comment_form', $post_id ); ?>1530 1522 </form> 1531 1523 <?php endif; ?> 1532 1524 </div>