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. Built from https://develop.svn.wordpress.org/trunk@34794 git-svn-id: http://core.svn.wordpress.org/trunk@34759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e98b20e84
commit
d6865505d5
|
@ -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.' ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34793';
|
||||
$wp_version = '4.4-alpha-34794';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue