Make WordPress Core

Ticket #24171: 24171.1.diff

File 24171.1.diff, 769 bytes (added by danielbachhuber, 13 years ago)
  • wp-includes/post.php

     
    23312331        $post['post_status'] = 'trash';
    23322332        wp_insert_post($post);
    23332333
     2334        if ( 'page' == $post['post_type'] ) {
     2335                // if the page is defined in option page_on_front or post_for_posts,
     2336                // adjust the corresponding options
     2337                if ( get_option('page_on_front') == $post_id ) {
     2338                        update_option('show_on_front', 'posts');
     2339                        delete_option('page_on_front');
     2340                }
     2341                if ( get_option('page_for_posts') == $post_id ) {
     2342                        delete_option('page_for_posts');
     2343                }
     2344        } else {
     2345                unstick_post( $post_id );
     2346        }
     2347
    23342348        wp_trash_post_comments($post_id);
    23352349
    23362350        do_action('trashed_post', $post_id);