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
This commit is contained in:
Sergey Biryukov 2015-10-03 01:49:52 +00:00
parent 96faf97a0f
commit 68f5a79880
1 changed files with 2 additions and 3 deletions

View File

@ -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.' ) );
}