Checking for user role before group join
-
I’m rather new to writing plugins for WordPress, and am trying to fully understand actions, filters and hooks. So forgive me if just need to understand the basics better.
When a user clicks the “Join Group” button, I would like to check if they have a particular user role assigned before they are added to a group. Is there a particular hook that will accomplish this?
I know that “groups_action_join_group” evaluates a join request, and then “groups_join_group” is fired to add the user to the group– I’m just not sure how these two functions work in conjunction with each other. And how would I go about hooking my custom function to this process? If I use “groups_join_group,” it seems that doesn’t fire until after the user has joined.
Thanks,
- You must be logged in to reply to this topic.