Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    We don’t do that out of the box by design because it was our logic that they shouldn’t lose the points or the achievement(s) simply because they decided to leave the group later on. However, that’s not always going to be the desired effect by everyone. That said, we still don’t have anything in the core plugin to handle it, so it’ll need to be custom done by those who happen to want to have that effect.

    There is the following hook from BuddyPress:

    do_action( 'groups_leave_group', $group_id, $user_id );

    You would need to find a way to determine how many points are needing deducted, as well as what achievements need to be removed still, but you would be provided the group’s ID and the user’s ID.

    For point handling, I’d check out the includes/points-functions.php file. For the achievement revoking, once you have the achievement ID isolated, you can use function badgeos_revoke_achievement_from_user( $achievement_id = 0, $user_id = 0 ).

    Thread Starter MonkimoE

    (@monkimoe)

    HI Michael,

    Thank you for the guide, I will try it on.

    I agree for the points not deducted. I just need to remove the badge to show if the member no longer have in the group again. Thank you to point me that.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘deduct point and remove badges if leave the group’ is closed to new replies.