WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/20/2010 11:48:38 AM (8 years ago)
Author:
nacin
Message:

Show awareness of comment's current status when moderating via e-mail/AYS. Show message on AYS screen of comment's status if not unapproved. Skip AYS when trying to re-approve (or delete or spam) a comment and show a message. See #11441

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r13246 r13247  
    142142}
    143143
    144 if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) ) {
     144if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) || isset($_GET['same']) ) {
    145145    $approved  = isset( $_GET['approved']  ) ? (int) $_GET['approved']  : 0;
    146146    $deleted   = isset( $_GET['deleted']   ) ? (int) $_GET['deleted']   : 0;
     
    149149    $spammed   = isset( $_GET['spammed']   ) ? (int) $_GET['spammed']   : 0;
    150150    $unspammed = isset( $_GET['unspammed'] ) ? (int) $_GET['unspammed'] : 0;
    151 
    152     if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) {
     151    $same      = isset( $_GET['same'] )      ? (int) $_GET['same']      : 0;
     152
     153    if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
    153154        if ( $approved > 0 )
    154155            $messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
     
    172173        if ( $deleted > 0 )
    173174            $messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
     175
     176        if ( $same > 0 && $comment = get_comment( $same ) ) {
     177            switch ( $comment->comment_approved ) {
     178                case '1' :
     179                    $messages[] = __('This comment is already approved.') . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
     180                    break;
     181                case 'trash' :
     182                    $messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
     183                    break;
     184                case 'spam' :
     185                    $messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
     186                    break;
     187            }
     188        }
    174189
    175190        echo '<div id="moderated" class="updated"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
Note: See TracChangeset for help on using the changeset viewer.