Skip to:
Content
Pages
Categories
Search
Top
Bottom

Action for Removing Member from group

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    You don’t want to remove the member via single Group > Admin > Members? Or are you considering removing a handful of members from the group/s?

    Avatar of seppy
    seppy
    Participant

    @seppy

    Hi @mercime ,

    What I am doing is when a User gets accepted into a group I’m automatically assigning them a set of permissions as well through an attached function.
    add_action( 'groups_membership_accepted', 'my_function' );

    But when someone is being removed from a group (through Group > Admin > Members) I can’t seem to find the action for that.
    add_action( 'groups_membership_removed?', 'my_other_function' );

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    groups_remove_member

    Avatar of seppy
    seppy
    Participant

    @seppy

    ahh, thanks heaps! Couldn’t find that anywhere :)

    Avatar of seppy
    seppy
    Participant

    @seppy

    @mercime

    Sorry, have one more question! Stuck on a similar issue again, the groups_remove_member worked a treat :) , but I also need to hook a function for when a person clicks “leave group” on their own accord.

    `add_action( ‘groups_leave_group‘, ‘function_here’ );`

    I tried ‘groups_leave_group’ but this doesn’t seem to work (unless I’m doing something stupid).

    Also I was wondering if you could clear up what the “screen” means in the actions like groups_screen_group_forum
    groups_screen_group_members
    groups_screen_group_invite
    groups_screen_group_leave

    Really appreciate your help so far!

    Avatar of seppy
    seppy
    Participant

    @seppy

    Can’t seem to get this working, I’ll just disable the ability to let people leave for now (so they can only be removed by admin). Doesn’t matter too much as the site is only private groups.

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.