Ticket #11534: trash-patch.diff
File trash-patch.diff, 2.6 KB (added by , 15 years ago) |
---|
-
wp-admin/admin-ajax.php
old new 228 228 die( (string) time() ); 229 229 $r = wp_unspam_comment( $comment->comment_ID ); 230 230 } elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) { 231 $r = wp_delete_comment( $comment->comment_ID );231 $r = wp_delete_comment( $comment->comment_ID, true ); 232 232 } else { 233 233 die('-1'); 234 234 } -
wp-admin/comment.php
old new 181 181 182 182 switch ( $action ) { 183 183 case 'deletecomment' : 184 wp_delete_comment( $comment_id );184 wp_delete_comment( $comment_id, true ); 185 185 $redir = add_query_arg( array('deleted' => '1'), $redir ); 186 186 break; 187 187 case 'trashcomment' : -
wp-admin/page.php
old new 195 195 if ( ! wp_delete_attachment($page_id) ) 196 196 wp_die( __('Error in deleting...') ); 197 197 } else { 198 if ( !wp_delete_post($page_id ) )198 if ( !wp_delete_post($page_id, true) ) 199 199 wp_die( __('Error in deleting...') ); 200 200 } 201 201 -
wp-admin/post.php
old new 231 231 if ( !current_user_can('delete_post', $post_id) ) 232 232 wp_die( __('You are not allowed to delete this post.') ); 233 233 234 $force = !EMPTY_TRASH_DAYS;235 234 if ( $post->post_type == 'attachment' ) { 236 $force = ( $force || !MEDIA_TRASH ); 237 if ( ! wp_delete_attachment($post_id, $force) ) 235 if ( ! wp_delete_attachment($post_id, true) ) 238 236 wp_die( __('Error in deleting...') ); 239 237 } else { 240 if ( !wp_delete_post($post_id, $force) )238 if ( !wp_delete_post($post_id, true) ) 241 239 wp_die( __('Error in deleting...') ); 242 240 } 243 241 -
wp-includes/comment.php
old new 813 813 * @param int $comment_id Comment ID 814 814 * @return bool False if delete comment query failure, true on success. 815 815 */ 816 function wp_delete_comment($comment_id ) {816 function wp_delete_comment($comment_id, $force_delete = false) { 817 817 global $wpdb; 818 818 if (!$comment = get_comment($comment_id)) 819 819 return false; 820 820 821 if ( wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0)821 if (!$force_delete && wp_get_comment_status($comment_id) != 'trash' && wp_get_comment_status($comment_id) != 'spam' && EMPTY_TRASH_DAYS > 0) 822 822 return wp_trash_comment($comment_id); 823 823 824 824 do_action('delete_comment', $comment_id);