Ticket #1810: 1810.diff

File 1810.diff, 2.5 KB (added by westi, 6 years ago)

Add AJAX delete to Mass Edit Mode

  • wp-admin/edit-comments.php

     
    152152                $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 
    153153                $class = ('alternate' == $class) ? '' : 'alternate'; 
    154154?> 
    155   <tr class='<?php echo $class; ?>'> 
     155  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'> 
    156156    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
    157157    <td><?php comment_author_link() ?></td> 
    158158    <td><?php comment_author_email_link() ?></td> 
     
    162162    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    163163        echo "<a href='comment.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td> 
    164164    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    165             echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\"    class='delete'>" . __('Delete') . "</a>"; } ?></td> 
     165                echo "<a href=\"comment.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars( $comment->comment_author, 1 ))  . "' );\" class='edit'>" . __('Delete') . "</a> "; 
     166                } ?></td> 
    166167  </tr> 
    167168                <?php  
    168169                } // end foreach 
     
    171172            <p class="submit"><input type="submit" name="delete_button" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="return confirm('<?php _e("You are about to delete these comments permanently \\n  \'Cancel\' to stop, \'OK\' to delete.") ?>')" /> 
    172173                        <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="return confirm('<?php _e("You are about to mark these comments as spam \\n  \'Cancel\' to stop, \'OK\' to mark as spam.") ?>')" /></p> 
    173174  </form> 
     175<div id="ajax-response"></div> 
    174176<?php 
    175177        } else { 
    176178?>