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:
parent
96faf97a0f
commit
68f5a79880
|
@ -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.' ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue