Make WordPress Core

Ticket #34133: 34133.diff

File 34133.diff, 2.2 KB (added by johnbillion, 9 years ago)
  • src/wp-admin/comment.php

     
    8181
    8282        $comment_id = absint( $_GET['c'] );
    8383
    84         if ( !$comment = get_comment_to_edit( $comment_id ) ) {
     84        if ( !$comment = get_comment( $comment_id ) ) {
    8585                wp_redirect( admin_url('edit-comments.php?error=1') );
    8686                die();
    8787        }
     
    151151<table class="form-table comment-ays">
    152152<tr>
    153153<th scope="row"><?php _e('Author'); ?></th>
    154 <td><?php echo $comment->comment_author; ?></td>
     154<td><?php comment_author( $comment ); ?></td>
    155155</tr>
    156 <?php if ( $comment->comment_author_email ) { ?>
     156<?php if ( get_comment_author_email( $comment ) ) { ?>
    157157<tr>
    158158<th scope="row"><?php _e('Email'); ?></th>
    159 <td><?php echo $comment->comment_author_email; ?></td>
     159<td><?php comment_author_email( $comment ); ?></td>
    160160</tr>
    161161<?php } ?>
    162 <?php if ( $comment->comment_author_url ) { ?>
     162<?php if ( get_comment_author_url( $comment ) ) { ?>
    163163<tr>
    164164<th scope="row"><?php _e('URL'); ?></th>
    165 <td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
     165<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td>
    166166</tr>
    167167<?php } ?>
    168168<tr>
     
    195195        <th scope="row"><?php _e( 'Submitted on' ); ?></th>
    196196        <td>
    197197        <?php
    198                 /* translators: 2: comment date, 3: comment time */
    199                 printf( __( '<a href="%1$s">%2$s at %3$s</a>' ),
    200                         esc_url( get_comment_link( $comment ) ),
     198                /* translators: 1: comment date, 2: comment time */
     199                $submitted = sprintf( __( '%1$s at %2$s' ),
    201200                        /* translators: comment date format. See http://php.net/date */
    202201                        get_comment_date( __( 'Y/m/d' ), $comment ),
    203202                        get_comment_date( get_option( 'time_format' ), $comment )
    204203                );
     204                if ( 'approved' === wp_get_comment_status( $comment ) ) {
     205                        printf(
     206                                '<a href="%s">%s</a>',
     207                                esc_url( get_comment_link( $comment ) ),
     208                                $submitted
     209                        );
     210                } else {
     211                        echo $submitted;
     212                }
    205213        ?>
    206214        </td>
    207215</tr>
    208216<tr>
    209217<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
    210 <td><?php echo $comment->comment_content; ?></td>
     218<td><?php comment_text( $comment ); ?></td>
    211219</tr>
    212220</table>
    213221