Changeset 13346
- Timestamp:
- 10/26/2022 09:06:02 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-invitations.php
r13172 r13346 106 106 $bp = buddypress(); 107 107 108 if ( ! $user_id ) {109 return;110 }111 112 108 // Check to see if this signup is the result of a valid invitation. 113 109 $invite = bp_get_members_invitation_from_request(); … … 116 112 } 117 113 118 // Accept the invitation.119 $invites_class = new BP_Members_Invitation_Manager();120 $args = array(121 'id' => $invite->id,122 );123 $invites_class->accept_invitation( $args );124 125 114 // User has already verified their email by responding to the invitation, so we can activate. 126 $key = bp_get_user_meta( $user_id, 'activation_key', true ); 115 $signup = bp_members_get_signup_by( 'user_email', $invite->invitee_email ); 116 $key = false; 117 if ( ! empty( $signup->activation_key ) ) { 118 $key = $signup->activation_key; 119 } 120 127 121 if ( $key ) { 128 122 $redirect = bp_get_activation_page(); … … 137 131 */ 138 132 $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $key ) ); 133 134 // Accept the invitation now that the user has been created. 135 $invites_class = new BP_Members_Invitation_Manager(); 136 $args = array( 137 'id' => $invite->id, 138 ); 139 $invites_class->accept_invitation( $args ); 139 140 140 141 // If there were errors, add a message and redirect.
Note: See TracChangeset
for help on using the changeset viewer.