WordPress.org

Make WordPress Core

Opened 9 years ago

Last modified 8 months ago

#17905 assigned defect (bug)

Multisite doesn't delete a user's posts/links upon removal

Reported by: duck_ Owned by: jeremyfelt
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Users Keywords: needs-refresh has-patch
Focuses: multisite Cc:

Description (last modified by duck_)

When the "Delete all posts and links." radio is selected all that happens is the user is deleted but their posts are left in tact but without a visible user. The posts should be moved to trash as well.

This is caused by removal from the blog in network/edit.php before the user is actually deleted where trashing of posts occurs. Since the user no longer has any assigned blogs wpmu_delete_user() doesn't call wp_delete_post().

Patch attached also cleans up confirm_delete_users slightly by using the array passed as an argument instead of $_POSTallusers?.

Related: [13918]

Attachments (2)

17905.diff (1.6 KB) - added by duck_ 9 years ago.
network-delete-user.patch (571 bytes) - added by clarinetlord 8 months ago.

Download all attachments as: .zip

Change History (8)

@duck_
9 years ago

#1 @duck_
9 years ago

  • Description modified (diff)

#3 @jeremyfelt
7 years ago

  • Component changed from Multisite to Users
  • Focuses multisite added

#4 @jeremyfelt
5 years ago

#32799 was marked as a duplicate.

#5 @wonderboymusic
5 years ago

  • Owner set to jeremyfelt
  • Status changed from new to assigned

#6 @clarinetlord
8 months ago

  • Keywords needs-refresh added

I'd like to resurrect this 9-year-old (!) issue, as this defect surfaced recently for our team. I'm supplying a new patch which is made from the current trunk and is narrower in scope than the previous patch. To summarize the OP, what happens is the user about to be deleted is currently removed from all sites whether or not their content is being deleted or reassigned. Because they are removed from all sites, the subsequent call to wpmu_delete_user() does not detect any role for the user on any sites and therefore does not remove any authored posts. Since wpmu_delete_user() internally calls remove_user_from_blog(), it's counterproductive to call it prematurely in the main process and incorrectly orphans all of that user's posts.

Note: See TracTickets for help on using tickets.