Open dparker1005 opened 3 years ago
As a workaround, this should be fixed by adding the following line to a custom plugin:
add_action('remove_user_from_blog', 'pmpro_delete_user');
Maybe this should go into core. @ideadude @andrewlimaza
I think this is okay, I'm happy with having this as a gist for now as removing a user from a site doesn't delete them and I'm worried that running this would affect their subscriptions on other sites.
In core PMPro, we remove a user's membership level when they are deleted; however on a multisite, "deleting" a user from the WP Users page on a subsite does not run the delete hooks. This means that users can have membership levels on a site that they are no longer a user on.
To fix this, we need to additionally remove a user's membership level on the "remove_user_from_blog" hook: https://developer.wordpress.org/reference/hooks/remove_user_from_blog/