WordPress.org

Make WordPress Core

Changeset 32796


Ignore:
Timestamp:
06/16/2015 06:53:16 PM (4 years ago)
Author:
helen
Message:

Comments: Better markup for the edit screen.

Previously there were no labels, and since labels can't contain links and the links were of dubious value, we've removed those.

props afercia, DrewAPicture.
fixes #31326.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r32509 r32796  
    20692069#post-body #post-body-content #namediv h3 {
    20702070    margin-top: 0;
     2071}
     2072
     2073.edit-comment-author {
     2074    font-size: 14px;
     2075    line-height: 1.4;
     2076    font-weight: 600;
     2077    color: #222;
    20712078}
    20722079
  • trunk/src/wp-admin/edit-form-comment.php

    r31862 r32796  
    2222
    2323<div id="post-body" class="metabox-holder columns-2">
    24 <div id="post-body-content" class="edit-form-section">
     24<div id="post-body-content" class="edit-form-section edit-comment-section">
    2525<div id="namediv" class="stuffbox">
    26 <h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
    2726<div class="inside">
     27<fieldset>
     28<legend class="edit-comment-author"><?php _e( 'Author' ) ?></legend>
    2829<table class="form-table editcomment">
    2930<tbody>
    3031<tr>
    31     <td class="first"><?php _e( 'Name:' ); ?></td>
     32    <td class="first"><label for="name"><?php _e( 'Name:' ); ?></label></td>
    3233    <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
    3334</tr>
    3435<tr>
    35     <td class="first">
    36     <?php
    37         if ( $comment->comment_author_email ) {
    38             printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
    39         } else {
    40             _e( 'E-mail:' );
    41         }
    42 ?></td>
    43     <td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" /></td>
     36    <td class="first"><label for="email"><?php _e( 'E-mail:' ); ?></label></td>
     37    <td>
     38        <input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" />
     39    </td>
    4440</tr>
    4541<tr>
    46     <td class="first">
    47     <?php
    48         if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
    49             $link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
    50             $author = get_comment_author( $comment->comment_ID );
    51             /** This filter is documented in wp-includes/comment-template.php */
    52             printf( __( 'URL (%s):' ), apply_filters( 'get_comment_author_link', $link, $author, $comment->comment_ID ) );
    53         } else {
    54             _e( 'URL:' );
    55         } ?></td>
    56     <td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" /></td>
     42    <td class="first"><label for="newcomment_author_url"><?php _e( 'URL:' ); ?></label></td>
     43    <td>
     44        <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" />
     45    </td>
    5746</tr>
    5847</tbody>
    5948</table>
    6049<br />
     50</fieldset>
    6151</div>
    6252</div>
     
    6454<div id="postdiv" class="postarea">
    6555<?php
     56    echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
    6657    $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
    6758    wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
     
    8677<div id="misc-publishing-actions">
    8778
    88 <div class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
     79<fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
     80<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
    8981<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ _ex('Approved', 'adjective') ?></label><br />
    9082<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ _ex('Pending', 'adjective') ?></label><br />
    9183<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ _ex('Spam', 'adjective'); ?></label>
    92 </div>
     84</fieldset>
    9385
    9486<?php if ( $ip = get_comment_author_IP() ) : ?>
    9587<div class="misc-pub-section misc-pub-comment-author-ip">
    96     <?php _e( 'IP address:' ); ?> <strong><a href="<?php echo esc_url( sprintf( 'http://whois.arin.net/rest/ip/%s', $ip ) ); ?>"><?php echo esc_html( $ip ); ?></a></strong>
     88    <span aria-hidden="true"><?php _e( 'IP address:' ); ?></span> <strong><a href="<?php echo esc_url( sprintf( 'http://whois.arin.net/rest/ip/%s', $ip ) ); ?>"> <span class="screen-reader-text"><?php _e( 'IP address:' ); ?> </span><?php echo esc_html( $ip ); ?></a></strong>
    9789</div>
    9890<?php endif; ?>
     
    10597$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
    10698?>
    107 <span id="timestamp"><?php printf($stamp, $date); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
     99<span id="timestamp"><?php printf( $stamp, $date ); ?></span>
     100<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
    108101<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
    109102</div>
Note: See TracChangeset for help on using the changeset viewer.