bp_members_invitations_accepted_invitation_notification( BP_Invitation $invite, WP_user $new_user, int $inviter_id )
Notify one use that another user has accepted their site membership invitation.
Parameters Parameters
- $invite
-
(BP_Invitation) (Required) Invitation that was accepted.
- $new_user
-
(WP_user) (Required) User who accepted the membership invite.
- $inviter_id
-
(int) (Required) ID of the user who invited this user to the site.
Source Source
File: bp-members/bp-members-notifications.php
function bp_members_invitations_accepted_invitation_notification( $invite, $new_user, $inviter_id ) { // Notify all inviters. $args = array( 'invitee_email' => $new_user->user_email, 'accepted' => 'all', ); $invites = bp_members_invitations_get_invites( $args ); if ( ! $invites ) { return; } foreach ( $invites as $invite) { // Include the id of the "accepted" invitation. if ( $invite->inviter_id === $inviter_id ) { $secondary_item_id = $invite->id; } else { // Else don't store the invite id, so we know this is not the primary. $secondary_item_id = 0; } $res = bp_notifications_add_notification( array( 'user_id' => $invite->inviter_id, 'item_id' => $new_user->ID, 'secondary_item_id' => $secondary_item_id, 'component_name' => buddypress()->members->id, 'component_action' => 'accepted_invitation', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
8.0.0 | Introduced. |