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

Use groups_$action_member() function to manage memberships #507

Merged
merged 2 commits into from
May 25, 2024
Merged

Use groups_$action_member() function to manage memberships #507

merged 2 commits into from
May 25, 2024

Conversation

imath
Copy link
Contributor

@imath imath commented May 21, 2024

Working on https://buddypress.trac.wordpress.org/ticket/9158 I realized using BP_Groups_Member->$action() methods was not a great idea. We really need to use groups_$action_member() functions instead.

In buddypress/buddypress#293 I'm updating these functions so that it's possible to use them from the REST API (the bp_is_item_admin() checks were restricting their use to the Web).

This makes sure cache is cleared, group activities are removed when needed etc...
See: https://github.com/buddypress/buddypress/blob/edd1d2e33a2a4d3ace8216e06ba846a36f452b88/src/bp-groups/bp-groups-cache.php#L391|L394

@imath imath requested a review from renatonascalves May 21, 2024 22:37
@imath
Copy link
Contributor Author

imath commented May 21, 2024

Failing tests will stop fail once buddypress/buddypress#293 is committed!

Copy link
Member

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

imath added 2 commits May 25, 2024 06:53
This makes sure cache is cleared, group activities are removed etc..
@imath imath merged commit 89ded5b into buddypress:master May 25, 2024
9 checks passed
@imath imath deleted the do-fire/group-member-hooks branch May 25, 2024 04:59
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

Successfully merging this pull request may close these issues.

2 participants