Disable trash for attachments for now pending improvements in 3.0, fixes #11149

git-svn-id: https://develop.svn.wordpress.org/trunk@12377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-12-12 06:40:16 +00:00
parent ee79c9e7d0
commit 770fd776d7
7 changed files with 26 additions and 11 deletions
+4 -2
View File
@@ -231,11 +231,13 @@ case 'delete':
if ( !current_user_can('delete_post', $post_id) )
wp_die( __('You are not allowed to delete this post.') );
$force = !EMPTY_TRASH_DAYS;
if ( $post->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($post_id) )
$force = ( $force || !MEDIA_TRASH );
if ( ! wp_delete_attachment($post_id, $force) )
wp_die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($post_id) )
if ( !wp_delete_post($post_id, $force) )
wp_die( __('Error in deleting...') );
}