Make WordPress Core


Ignore:
Timestamp:
03/06/2015 02:05:05 PM (12 years ago)
Author:
helen
Message:

Comments: Show more identifying information for moderation and editing.

Attempting to moderate comments without context about the post is more difficult than necessary. The comment moderation screen you are sent to via email link was also in need of some better visual treatment.

props thaicloud, seanchayes, adamsilverstein.
see #23988.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/comment.php

    r31128 r31641  
    115115<div class="wrap">
    116116
    117 <div class="narrow">
    118 
    119117<h2><?php echo esc_html( $title ); ?></h2>
    120118
    … …  
    123121        case 'spam' :
    124122                $caution_msg = __('You are about to mark the following comment as spam:');
    125                 $button      = __('Spam Comment');
     123                $button      = __('Mark as Spam');
    126124                break;
    127125        case 'trash' :
    128126                $caution_msg = __('You are about to move the following comment to the Trash:');
    129                 $button      = __('Trash Comment');
     127                $button      = __('Move to Trash');
    130128                break;
    131129        case 'delete' :
    … …  
    159157
    160158<table class="form-table comment-ays">
    161 <tr class="alt">
     159<tr>
    162160<th scope="row"><?php _e('Author'); ?></th>
    163161<td><?php echo $comment->comment_author; ?></td>
    … …  
    176174<?php } ?>
    177175<tr>
     176        <th scope="row"><?php _e( 'In Response To' ); ?></th>
     177        <td>
     178        <?php
     179                $post_id = $comment->comment_post_ID;
     180                if ( current_user_can( 'edit_post', $post_id ) ) {
     181                        $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
     182                        $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
     183                } else {
     184                        $post_link = esc_html( get_the_title( $post_id ) );
     185                }
     186                echo $post_link;
     187
     188                if ( $comment->comment_parent ) {
     189                        $comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
     190                        $parent      = get_comment( $comment->comment_parent );
     191                        $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
     192                        $name        = get_comment_author( $parent->comment_ID );
     193                        printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
     194                }
     195        ?>
     196        </td>
     197</tr>
     198<tr>
     199        <th scope="row"><?php _e( 'Submitted on' ); ?></th>
     200        <td>
     201        <?php
     202                /* translators: 2: comment date, 3: comment time */
     203                printf( __( '<a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
     204                        /* translators: comment date format. See http://php.net/date */
     205                        get_comment_date( __( 'Y/m/d' ) ),
     206                        get_comment_date( get_option( 'time_format' ) )
     207                );
     208        ?>
     209        </td>
     210</tr>
     211<tr>
    178212<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
    179213<td><?php echo $comment->comment_content; ?></td>
    … …  
    181215</table>
    182216
    183 <p><?php _e('Are you sure you want to do this?'); ?></p>
    184 
    185 <form action="comment.php" method="get">
    186 
    187 <table width="100%">
    188 <tr>
    189 <td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
    190 <td class="textright"><?php submit_button( $button, 'button' ); ?></td>
    191 </tr>
    192 </table>
     217<form action="comment.php" method="get" class="comment-ays-submit">
     218
     219<p>
     220        <?php submit_button( $button, 'primary', 'submit', false ); ?>
     221        <a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
     222</p>
    193223
    194224<?php wp_nonce_field( $nonce_action ); ?>
    … …  
    198228</form>
    199229
    200 </div>
    201230</div>
    202231<?php
Note: See TracChangeset for help on using the changeset viewer.