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/comment.php

    r13246 r13247  
    8484    }
    8585
     86    // No need to re-approve/re-trash/re-spam a comment.
     87    if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) {
     88        wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
     89        die();
     90    }
     91
    8692    require_once('admin-header.php');
    8793
     
    117123        break;
    118124}
     125
     126if ( $comment->comment_approved != '0' ) { // if not unapproved
     127    $message = '';
     128    switch ( $comment->comment_approved ) {
     129        case '1' :
     130            $message = __('This comment is currently approved.');
     131            break;
     132        case 'spam' :
     133            $message  = __('This comment is currently marked as spam.');
     134            break;
     135        case 'trash' :
     136            $message  = __('This comment is currently in the Trash.');
     137            break;
     138    }
     139    if ( $message )
     140        echo '<div class="updated"><p>' . $message . '</p></div>';
     141}
    119142?>
    120 
    121143<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
    122144
Note: See TracChangeset for help on using the changeset viewer.