WordPress.org

Make WordPress Core

Ticket #16358: 16358-static.diff

File 16358-static.diff, 634 bytes (added by nacin, 7 years ago)

Restrict to posts, pages, attachments.

  • wp-admin/includes/user.php

     
    278278        do_action('delete_user', $id);
    279279
    280280        if ( 'novalue' === $reassign || null === $reassign ) {
    281                 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
     281                $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('post', 'page', 'attachment')", $id) );
    282282
    283283                if ( $post_ids ) {
    284284                        foreach ( $post_ids as $post_id )