mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
+4
-2
@@ -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...') );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user