[buddypress-trac] [BuddyPress Trac] #8175: Calling `wp_delete_user()` on multisite should not trigger data deletion
buddypress-trac
noreply at wordpress.org
Thu Dec 5 19:44:43 UTC 2019
#8175: Calling `wp_delete_user()` on multisite should not trigger data deletion
-----------------------------------+---------------------
Reporter: boonebgorges | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0.0
Component: Members | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion has-patch |
-----------------------------------+---------------------
Changes (by boonebgorges):
* keywords: 2nd-opinion => 2nd-opinion has-patch
Comment:
Thanks to both of you for your feedback.
@johnjamesjacoby A wrapper function seems reasonable to me. The obvious
situation where it might be valuable is in multi-network, when you may
well want `wp_delete_user()` to remove (that network's) user data. I chose
the function name and signature `bp_remove_user_data_on_delete_user_hook(
$data_type, $user_id )`, so that plugins can filter on a per-component or
per-user basis if they'd like. See the function definition in
[attachment:"8175.2.diff"] bp-members-functions.php
@imath Thanks for reviewing. IMO cache invalidation is the opposite of
data deletion, in the sense that we want to err on the side of NOT
deleting data, while we should err on the side of TOO MUCH invalidation.
Put another way, it seems reasonable to me that `wp_delete_user()` on
multisite would trigger a cache flush, even if it doesn't delete data,
just out of caution.
Apologies for the very large [attachment:"8175.2.diff"]. Most of it is
tests, and the pattern is the same across the components. I'd mainly like
a last sanity check on the general approach, as well as any feedback on
function names.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8175#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list