WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/03/2015 01:49:52 AM (6 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/post.php

    r34177 r34794  
    255255        wp_die( __( 'You are not allowed to delete this item.' ) );
    256256
    257     $force = ! EMPTY_TRASH_DAYS;
    258257    if ( $post->post_type == 'attachment' ) {
    259         $force = ( $force || ! MEDIA_TRASH );
     258        $force = ( ! MEDIA_TRASH );
    260259        if ( ! wp_delete_attachment( $post_id, $force ) )
    261260            wp_die( __( 'Error in deleting.' ) );
    262261    } else {
    263         if ( ! wp_delete_post( $post_id, $force ) )
     262        if ( ! wp_delete_post( $post_id, true ) )
    264263            wp_die( __( 'Error in deleting.' ) );
    265264    }
Note: See TracChangeset for help on using the changeset viewer.