bp_invites_member_invite_activate_user( $user_id, $key, $user )
Mark the invited user as registered.
Description
Parameters
- $user_id
-
(Required)
- $key
-
(Required)
- $user
-
(Required)
Source
File: bp-invites/bp-invites-functions.php
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | function bp_invites_member_invite_activate_user( $user_id , $key , $user ) { global $bp ; $email = bp_core_get_user_email( $user_id ); $inviters = array (); $args = array ( 'post_type' => bp_get_invite_post_type(), 'posts_per_page' => -1, 'meta_query' => array ( array ( 'key' => '_bp_invitee_email' , 'value' => $email , 'compare' => '=' , ), ), ); $bp_get_invitee_email = new WP_Query( $args ); if ( $bp_get_invitee_email ->have_posts() ) { // From the posts returned by the query, get a list of unique inviters while ( $bp_get_invitee_email ->have_posts() ) { $bp_get_invitee_email ->the_post(); $inviter_id = get_the_author_meta( 'ID' ); $inviters [] = $inviter_id ; // Mark as accepted update_post_meta( get_the_ID(), '_bp_invitee_status' , 1 ); update_post_meta( get_the_ID(), '_bp_invitee_registered_date' , date ( 'Y-m-d H:i:s' ) ); $member_type = get_post_meta( get_the_ID(), '_bp_invitee_member_type' , true ); if ( isset( $member_type ) && ! empty ( $member_type ) ) { bp_set_member_type( $user_id , '' ); bp_set_member_type( $user_id , $member_type ); } } } } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.