Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed users do not lose membership #23

Open
dparker1005 opened this issue Feb 24, 2021 · 2 comments
Open

Removed users do not lose membership #23

dparker1005 opened this issue Feb 24, 2021 · 2 comments

Comments

@dparker1005
Copy link
Member

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/

@dparker1005
Copy link
Member Author

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

@andrewlimaza
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants