Skip to:
Content

BuddyPress.org

Ticket #7410: 7410.diff

File 7410.diff, 1.2 KB (added by jdgrimes, 8 years ago)

Pass the inviter ID as the third action arg

  • src/bp-groups/bp-groups-functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    14251425        }
    14261426
    14271427        $member = new BP_Groups_Member( $user_id, $group_id );
     1428
     1429        // Save the inviter ID so that we can pass it to the action below.
     1430        $inviter_id = $member->inviter_id;
     1431
    14281432        $member->accept_invite();
    14291433
    14301434        if ( !$member->save() ) {
     
    14431447         * Fires after a user has accepted a group invite.
    14441448         *
    14451449         * @since 1.0.0
     1450         * @since 2.8.0 The $inviter_id arg was added.
    14461451         *
    1447          * @param int $user_id  ID of the user who accepted the group invite.
    1448          * @param int $group_id ID of the group being accepted to.
     1452         * @param int $user_id    ID of the user who accepted the group invite.
     1453         * @param int $group_id   ID of the group being accepted to.
     1454         * @param int $inviter_id ID of the user who invited this user to the group.
    14491455         */
    1450         do_action( 'groups_accept_invite', $user_id, $group_id );
     1456        do_action( 'groups_accept_invite', $user_id, $group_id, $inviter_id );
    14511457
    14521458        return true;
    14531459}