WordPress.org

Make WordPress Core

Ticket #7774: 7774.diff

File 7774.diff, 785 bytes (added by scohoust, 11 years ago)
  • Users/Scott/Sites/wp/trunk/wp-admin/includes/user.php

     
    424424                }
    425425
    426426                // Clean links
    427                 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
     427                $link_ids = $wpdb->get_col( $wpdb->prepare("SELECT LINK_ID FROM $wpdb->links WHERE link_owner = %d", $id) );
     428
     429                if ($link_ids) {
     430                        foreach ($link_ids as $link_id)
     431                                wp_delete_link($link_id);
     432                }
     433
    428434        } else {
    429435                $reassign = (int) $reassign;
    430436                $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) );