Ticket #8684: edit-comments.diff
| File edit-comments.diff, 1.3 KB (added by mrmist, 3 years ago) |
|---|
-
edit-comments.php
18 18 check_admin_referer('bulk-spam-delete', '_spam_nonce'); 19 19 20 20 $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] ); 21 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 22 21 if ( current_user_can('moderate_comments')) { 22 $deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" ); 23 } else { 24 $deleted_spam = 0; 25 } 23 26 $redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam; 24 27 if ( $post_id ) 25 28 $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to ); … … 272 275 <?php } 273 276 274 277 if ( 'spam' == $comment_status ) { 275 wp_nonce_field('bulk-spam-delete', '_spam_nonce'); ?> 276 <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 277 <?php } ?> 278 wp_nonce_field('bulk-spam-delete', '_spam_nonce'); 279 if ( current_user_can ('moderate_comments')) { ?> 280 <input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" /> 281 <?php } 282 } ?> 278 283 <?php do_action('manage_comments_nav', $comment_status); ?> 279 284 </div> 280 285
