Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
When a network admin deletes a user and chooses "Delete all content." for a site, the content was never deleted. The handler in
network/users.phpremoved the user from every site that wasn't set to "reassign" before callingwpmu_delete_user(). That function only deletes posts and links on sites the user still belongs to, so the user's content stayed behind, orphaned.Changes
network/users.phpmoves into a private helper,_wpmu_reassign_deleted_users_content(). It exists only so the handler's behavior can be tested, since the handler itself ends inwp_redirect()andexit. The alternative is deleting theelsebranch inline.wpmu_delete_user()now reaches those sites and deletes the user's posts and links there.isset()on thedelete[ site ][ user ]choice, which avoids an undefined-index notice when a key is missing.Behavior note
wpmu_delete_user()already does it, throughwp_delete_post()without force. Posts are therefore moved to the trash when the trash is enabled, matching single-sitewp_delete_user(). The trash-versus-delete question raised in the ticket is not changed here.Tests
Tests_Multisite_wpmuReassignDeletedUsersContentcovers delete on every site, reassign on one site with delete on another, membership kept on delete sites, and the capability check. The first three fail without the fix.Trac ticket: https://core.trac.wordpress.org/ticket/17905
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Implementation, tests, and PR description.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Trac Tickets.