WordPress.org

Make WordPress Core

Ticket #11426: 11426.diff

File 11426.diff, 3.2 KB (added by nacin, 8 years ago)

First pass...

  • wp-admin/comment.php

     
    7676if ( 'spam' == $_GET['dt'] ) {
    7777        $caution_msg = __('You are about to mark the following comment as spam:');
    7878        $button = __('Spam Comment');
     79} elseif ( 'trash' == $_GET['dt'] ) {
     80        $caution_msg = __('You are about to move the following comment to the Trash:');
     81        $button = __('Trash Comment');
    7982} elseif ( 'cdc' == $action ) {
    8083        $caution_msg = __('You are about to delete the following comment:');
    8184        $button = __('Delete Comment');
     
    102105<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
    103106<?php if ( 'spam' == $_GET['dt'] ) { ?>
    104107<input type='hidden' name='dt' value='spam' />
     108<?php } elseif ( 'trash' == $_GET['dt'] ) { ?>
     109<input type='hidden' name='dt' value='trash' />
    105110<?php } ?>
    106111<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
    107112<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
     
    152157                comment_footer_die( __('You are not allowed to edit comments on this post.') );
    153158
    154159        if ( 'spam' == $_REQUEST['dt'] )
    155                 wp_set_comment_status( $comment->comment_ID, 'spam' );
     160                wp_spam_comment( $comment->comment_ID );
     161        elseif ( 'trash' == $_REQUEST['dt'] )
     162                wp_trash_comment( $comment->comment_ID );
    156163        else
    157164                wp_delete_comment( $comment->comment_ID );
    158165
  • wp-includes/pluggable.php

     
    10171017                $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
    10181018        }
    10191019        $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
    1020         $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
     1020        if ( EMPTY_TRASH_DAYS )
     1021                $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=cdc&dt=trash&c=$comment_id") ) . "\r\n";
     1022        else
     1023                $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
    10211024        $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
    10221025
    10231026        $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
     
    11021105        }
    11031106
    11041107        $notify_message .= sprintf( __('Approve it: %s'),  admin_url("comment.php?action=mac&c=$comment_id") ) . "\r\n";
    1105         $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
     1108        if ( EMPTY_TRASH_DAYS )
     1109                $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=cdc&dt=trash&c=$comment_id") ) . "\r\n";
     1110        else
     1111                $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=cdc&c=$comment_id") ) . "\r\n";
    11061112        $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=cdc&dt=spam&c=$comment_id") ) . "\r\n";
    11071113
    11081114        $notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',