From 68f5a798804210198b694762d58b7641b6e89829 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 3 Oct 2015 01:49:52 +0000 Subject: [PATCH] Respect the `force_delete` parameter of `get_delete_post_link()`. Previously, it only worked if `EMPTY_TRASH_DAYS` was disabled. Props johnbillion, chriscct7. Fixes #26832. git-svn-id: https://develop.svn.wordpress.org/trunk@34794 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/post.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index ba43eb1c2b..174a949d35 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -254,13 +254,12 @@ case 'delete': if ( ! current_user_can( 'delete_post', $post_id ) ) wp_die( __( 'You are not allowed to delete this item.' ) ); - $force = ! EMPTY_TRASH_DAYS; if ( $post->post_type == 'attachment' ) { - $force = ( $force || ! MEDIA_TRASH ); + $force = ( ! MEDIA_TRASH ); if ( ! wp_delete_attachment( $post_id, $force ) ) wp_die( __( 'Error in deleting.' ) ); } else { - if ( ! wp_delete_post( $post_id, $force ) ) + if ( ! wp_delete_post( $post_id, true ) ) wp_die( __( 'Error in deleting.' ) ); }